Saturday, 15 May 2010

c++ - Boost BGL Dijkstra Shortest Paths -


I'm not familiar with boost libraries and am trying to learn. I used the Bust Graphics Library to call at least routes of the Dzestra to find a path to the destination in a map. Verticals are intersection and edges are road segments

For the least time I am getting the shortest route, for this, I have the width of the edges defined as the time limit, time = St. block length * Its speed / Bound It actually gives me less time (up to time) However, I also account for a turn and add 15 seconds to each of the total time. How do I find out that a twist is given two road blocks (edges), if the second name is not equal to the first Saint name, then this is a turn.

Actually, I want to weights (not just in the beginning, as I am doing here). When the program touches an edge during the search, I want to check it at this level (parent or previous). How can I do this in a function or another argument that can do this?

vector & lt; Unsigned & gt; OurGraph :: find_awesome_path (unsigned start, unsigned complete) {// Start and end in intersection ID, // get related verses in graph Vertex start_node = vertex_map [Start]; Vertex dest_node = vertex_map [finish]; Std :: vector & lt; Vertex & gt; Predecessors (boost: num_vertices (my_graph)); // Std :: vector to store the parents & lt; Float & gt; Distance (boost: num_vertices (my_graph)); // IndexMap indexMap = boost :: get (boost :: vertex_index, my_graph) to store secondary distance; Preceding map preceding map (and predecessor [0], indexmap); Distance map distance (and distance [0], indexmap); Boost :: dijkstra_shortest_paths (my_graph, start_node, boost :: distance_map (distance map) .predecessor_map (predecessorMap)); Of vector & lt; Edge & gt; Path; Path = get_edge_path (dest_node, predecessorMap); // Removes the edges from the details of the edge in the previous map and piled them in a vector in the edge. Return segment_list_frame_edge (path); // Road segment ID and return edges to return. }

where my_graph is a type of graph and graphs, vertices, edges, indexmaps, predesorption and < Em> distance map types are defined as the following:

  typedef boost :: property & lt; Boost :: edge_weight_t, float & gt; WeightProperty; Typedef boost :: property & lt; Promotion: vertex_name_t, unsigned & gt; IntersectionProperty; Typedef boost :: adjacency_list & lt; Promotion: List S, Promotion :: VCS, Promotion :: Director, Interaction Property, Wetproperty & gt; Graph; Typedef boost :: graph_traits & lt; Graph & gt; :: vertex_descriptor vertex; Typedef boost :: graph_traits & lt; Graph & gt; :: Age_descriptor edge; Typedef Promotion: Property_map & lt; Graph, boost :: vertex_indx_t & gt; :: type indexmap; Typedef boost :: iterator_property_map & lt; Vertex *, IndexMap, Vertex, Vertex and Embedded & Gt; PredecessorMap; Typedef boost :: iterator_property_map & lt; Float *, indexmap, float, float & amp; & Gt; DistanceMap;  

You can do this using a difference graph in that case the difference graph In each head will be equal to the edge of your current graph. Then a top example would encapsulate a turn, then you can rotate the edges in which the change in the name of the road (or whatever mechanism you use, to change the use.)


model view controller - CSRF token is null on file upload- spring mvc -


मैं एक फ़ाइल अपलोड कर रहा हूँ। Jsp में निम्नलिखित हैं।

  & lt; form id = "uploadRepoData" enctype = "multipart / form-data" & gt; & Lt; इनपुट शैली = "चौड़ाई: 250 पीएक्स" प्रकार = "फ़ाइल" नाम = "लोडफाइल" वर्ग = "लोड इनपुट डिसप्ले" / & gt;  

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

मुझे यकीन नहीं है कि यह कैसे ठीक करें।

csrf टोकन को एक्शन के लिए एक क्वेरी पैरामीटर के रूप में जोड़कर


java - Wicket: How to use Map instead of PropertyModel? -


We are all right with the user's wicket 6 and POJO objects and property modal to access model objects. Now instead of a POJO, I want to use a map, how can I do this?

add.add (new TextField & lt; string & Gt; ("fieldName", new property model & lt; string & gt; (pojo, "fieldName")));

I like something

  form.add (new TextField & lt; string & gt; ("fieldName", new mappeload & lt; string & Gt; (map, "workspace name")));  

Is there any wicket class to do this?

I think the following should be done:

  form. Add (new textfield & lt; string & gt; ("field name", new property model ATP; string> (map, "keyname")));  

jquery ui drag and drop - divs not stacking -


I made an example to drug a div in the second and it is inserted into the divide.

  $ (".draggable"). Drug Gables ({Stack: "Dragable"}); $ ("#droppable") .Droppable ({drop: function (ev, ui) {var offset = ui.helper.offset (); ui.helper.appendTo (this) .offset (offset);}});  

This is working fine but when I have to divide, I can stack them first, but when I pull them back again, they will not stack.

Any thoughts I am doing wrong?

You "." In the stack: "Dragable"

Fixed code:

  $ (".draggable") .dragable ({stack: "draggable"}); $ ("#droppable") .Droppable ({drop: function (ev, ui) {var offset = ui.helper.offset (); ui.helper.appendTo (this) .offset (offset);}});  

php - Posting form data to the same page -


I want to post the form-data on the same page where the form is, but the URL looks like this Domain.com/index.php?id=foo , $ _SERVER ['PHP_SELF'] index.php returns when I set the form asset equivalent to domain / index.fpp.id = fo I do not watch this, any suggestions?

Just leave your action = "" attribute in your form Empty

Now, actually submit your form, a & lt; Input type = "submit" name = "your buttons" & gt;

And in your PHP script, just check whether the button has been presented with a simple release function, like

  if (isset ($ _ POST ['yourbutton'])) {// all in one page}  

ios - TestFlight error: User gets "Unable to Download Application" message when trying to download a beta test from TestFlight -


I'm testing my app beta, and some users are getting the "unable to download the app" error. Can be downloaded at this time ". So far 30 users have downloaded the beta of the app, and only 2 are getting the error, so it seems to be a user rather than an app-specific. ?

The message is similar to this post, but with the current iOS 8 formatting:

The most likely reason is that their iOS OS version below the minimum OS version of the app . Strange as

Because it gives sound to the official Apple TestFlight / iTunes Connect Beta system Do not check all of the OS version at this time We were working on our integration with the new testflight system (iOS CI / CD service - CTO here).

For example, one of our testing apps with iOS 8.2, OS was created in the form of The screen is listed on the app's card in this testflight ( compatibility : requires iOS 8.2 or later) but you can still click on the install button and start downloading and installing it. Then you definitely get useful error messages with unable to download the app .

Note: tested on two different iPads, both with iOS 8.1.3 .

Another, less likely problem may be the lack of storage on the device but as far as I remember it presents a different error message.


python - How to update one NumPy array with values from a different array? -


अगर मेरे पास अलग-अलग आयामों के साथ दो अलग-अलग सरणियां थीं:

  loaded_data = np .arange (4674) .reshape (57, 41, 2) final_data = np.zeros ((60, 41, 2))  

मैं कैसे सबसे अधिक कुशलतापूर्वक अंतिम से डेटा को अद्यतन करेगा लोडेड_डेटा शून्य मूल्य के साथ अतिरिक्त कॉलम छोड़ रहा है?

आप अद्यतन करने के लिए एआरए स्लिसिंग का उपयोग कर सकते हैं

  final_data [ : Loaded_data.shape [0]] = लोडेड_डेटा  

Android Compiling ARM Native Application To x86 (Porting & Houdini) -


I'm researching how ARM applications can be compiled on x86 platforms and I have 2 topics (Houdini Binary Translator and porting) I have some problems with

Is this my question?

The difference between binary translation and porting What is

With the binary translation, your app translates libhodini using the ARM NDK binaries, and device ARM instructions using x86. This results in a small APK file because it contains only a few NDK binaries, however, the resulting translation is slow if the app has sent the XML NDK binaries to go with the ARM holder.

With porting, you obviously ship an ARM bearing X86 NDK binary. This results in a large APK file, but speeds up performance on x86 devices compared to LibHodini .

In either case, you should check your code on x86 devices as well as on the ARM device. Also, do not forget that we now have 64-bit ARM and X86 CPUs.


How to reference a .jar file within a Java program in Eclipse -


I have a .jar file that I can run from the terminal on OS X, which takes input from the terminal and output Is it possible to include this .jar file in an eclipse Java project even in the terminal, where I can input inside the Java project which goes to the .jar file and receives the output as a string Is there something I can manipulate?

Thank you very much.

The short answer is yes.

The "idiom" approach will be used to communicate with the jar through the program through the command line.

There would be a better way if Jar would expose any kind of API. So you just have to add the necessary class to the class and use the function as if you have any other function.


Visual Studio 2013 new project templates appear empty -


I have installed Video Studio 2013, and when I open a new project the template appears empty.

I also get this error:

I have tried to successfully install without restoring how to fix this error is?

I have installed Microsoft Visual Studio Tools for Office runtime.

I have Visual Studio 2013 installed, and installed Visual Studio 2012, the problem is solved. is.


Django - Render view on user_logged_out signal -


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

मैंने प्रत्येक ये, दोनों एक वर्ग आधारित और कार्यात्मक दृश्य के साथ, लेकिन उन्हें काम करने के लिए नहीं मिल सकता है। आईपीडीबी का इस्तेमाल करना मैं कंसोल में रेंडर करने के लिए एक टेम्पलेट प्राप्त कर सकता हूं, लेकिन इसे वापस करने का सही तरीका पता नहीं लगा सकता है / दृश्य को वापस लौटाया है विचार (प्रयोक्ता): # user_asignal_handler (प्रेषक, अनुरोध, उपयोगकर्ता, ** kwargs): अगर इस user.as_condition: # इस हल करने की कोशिश की (रिवर्स ('my_named_url', kwargs = { 'Kwarg1': 'कुछ'}))। Func (अनुरोध, कुछ) # और यह render_to_response (हल (रिवर्स ('my_named_url', kwargs = {'kwarg1': कुछ}))। Func (अनुरोध, kwarg1 = कुछ) .render ()) # और यह रेंडर (MyClassView.as_view () (अनुरोध, kwarg1 = कुछ)) # और यह वापसी (हल (रिवर्स ('my_named_url', kwargs = {'kwarg1': कुछ}))। Func ( अनुरोध, kwarg1 = कुछ) .render ()) # और यह वापसी HttpResponse (हल (रिवर्स ('my_named_url', kwargs = {'kwarg1': कुछ}))। Func (अनुरोध, kwarg1 = कुछ) .render ())

एक सिग्नल हेन्डलर दृश्य नहीं है, यह कोई प्रतिक्रिया नहीं दे सकता / वापसी नहीं कर सकता। < / P>

आप बस अपने ही दृश्य में तर्क संभाल सकते हैं, और कॉल करें या फिर एथॉग लॉगआउट फ़ंक्शन पर रीडायरेक्ट करें। नीचे की तरह कुछ। Django.shortcuts आयात डीआरएफ़ my_logout (अनुरोध) से:


zend framework - ZF2 main router in console -


How can I use the url () controller in the console?

I have to generate some URL through the action of the console, but if I do $ this-> Controller- & gt; Url () - & gt; Route from (...); , I can only ask for the routes defined in the console router.

In other words, I need the ability to call all the routes of the application's main router.

Thanks

I'm not sure this is a good decision, but you Manually convert router:

  // router / router HTTP $ this-> GetEvent () - & gt; SetRouter ($-- getServiceLocator () -> Get ('HttpRouter')); // Get the route ('your_http_route') from any HTTP path var_dump ($ this-> url () - & gt; // Change it back, if you want $ this-> GetEvent () - & gt; SetRouter ($-> getServiceLocator () - & gt; Receive ('router'));  

exploring avaliable commands in an applescript program -


I have an application and I can do the following command (I know because I googled for it) P

What I would really like to ask "TextMate" program:

  Tell the app "textmat" to list all orders and Give it a list of all the things from which I can ask to do this:  
  ..  

Is there a way to do this with applescript?

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

The way to find all commands in an app is to open your dictionary in your script editor . Usually "Open file ...", in the File menu, or leave the application on the script editor. [edit]

Apps that have Apple Script support, you can actually open the script with the script editor, a la Are: Set the Setup App (Choose the file of type "APPL") Tell the application "Script Editor" open path

but this is a non - Will be problematic with the scripting app. You will get an error, but the script editor will actually open some part of the app (and it will be slow about this), then give you an unneeded document There is no way to catch this error if you use the Smile Script Editor , You can use this method ...

  Open Paste (choose type "APPL" file) on error (as the nickname (P string)) Try E End  

... Try opening an app's dictionary, and if it does not work (if there is no dictionary in the app), then it returns an error But

[edit]

> Go down a rabbit hole, try system events or Finder Is doing, which is checking the boolean of , the scripting terminology of the process is property, but I do not recommend it Reliable because I could not find it.

[edit 3]

Ah! I knew there was another way but forgot what it was. According to @mkelment 0 (thank you), you can do this to test the script's capability of the app before opening the app in the script editor:

  set path as "APPL") The application pathToApp as the text set is isScriptable for the false try square - only the AppleScriptable applications have a square property set isscriptable to the true end to isScriptable  

asp.net mvc routing - MVC ignores route defaults and renders full “/Home/Index” URLs instead of root -


My ASP.NET MVC project route seems to be ignoring the default when composing URLs For example, Url.Action ("index", "home") return / home / index / , while returning it only to / There is no problem with url (which I have seen in all my other MVC websites) using , eg. By going to http: // myserver / , the default controller and verb get correctly.

How can I correct the behavior? (Note how I have done this behavior get , but no one is suffering from this opposite problem.)

This project is not fantastic, no custom routing handler is. , And routing configuration is quite simple: "public-static zero register routs" {routes.IgnoreRoute ("{resource} .axd / { * PathInfo} "); Routes.IgnoreRoute ("LoginHandler"); ("Default", url: "{controller} / {action} / {* id}", default: new {controller = "home", action = "index", id = urlParameter.optional}). ; }

( * is there because some actions use arbitrary strings in the form of identifiers which can include embedded slashes, and without asterisk, the path The URL does not match for this.)

The problem is actually in small asterisks UrlParameter.Optional does not match against default, and there are completely full paths in the URL.

If you want to keep the default behavior, while holding the arbitrary parameter - using all the parameter syntax, you need to use the catch-all parameters in a secondary route :

  public static zero registrations {routes.IgnoreRoute ("{resource} .axd / {* pathInfo}"); Routes.IgnoreRoute ("LoginHandler"); Routes.MapRoute (name: "default", url: "{controller} / {action} / {id}", default: new {controller = "home", action = "index", id = urlparameter.option}}; Routes (.: "CatchAll", url: "{controller} / {action} / {* id}", default: new {controller = "home", action = "index", id = UrlParameter.Optional}). ; }  

With this definition, simple parameters are not controlled using the first parameter (as the URL is the generation, which is not being specified as the correct path to use ), While the complex parameter with slash deterioration is back on the other path, and it is handled correctly.


(Note that this may only be a bug in the MVC implementation: Catch-For all parameters, MVC ParsedRoute.IsParameterRequired returns null < / Code> as the default parameter value, which is tested with the default of root from the UrlParameter.Optional supplied, and it is found individually.Therefore, if you change the route code Route definition changed to use default instead of id = UrlParameter.Optional instead of id = null . It also seems to work, but it seems to me that unwanted side effects can occur. I am also not sure whether this behavior has been deliberately done, or just a bug.)

< / Div>

multithreading - Is it safe to remove Rack::Lock? -


I'm getting this error on a pretty regular basis: Thread error: deadlock; Recursive locking I have read that if the Unicorn (which I am) rack :: lock is not required by adding it to config.middleware.delete "rack :: lock" I can remove it. Application.rb.

Does anyone have the opinion that whether the rack is safe to remove: lock from my production app?

For reference, general trace:

  ... dor / bundle / ruby ​​/ 2.0.0 / gem / rack -1.4.5 / Lib /rack/lock.rb:14:in `lock '... door / bundle / ruby ​​/ 2.0.0 / gem / rack-1.4.5 / leeb / rack / lock RB: 14: In 'call' ... bundle / ruby ​​/ 2.0.0/gems/rack-1.4.5/lib/rack/deflater.rb:13:in 'call' ... / bundle / ruby ​​/ 2.0 .0 / gem / rack-ssl-1.3.3 / lib / rack /ssl.rb:27:in 'call' ... by / 2.0.0 / gem / rack-cache -1.2 / lib / rack / cache / Reference. RB: 136: In 'forwarded' ... by / 2.0.0 / gem /rack-cache-1.2/lib/rack/cache/context.rburday45:in 'fetch' ... by / 2.0.0 / gemstone / Rack-cache-1.2 / lib / rack / cache / context.rb: 185: in 'Lookup' ... / 2.0.0 / gem / rack-cache -1.2 / leeb / rack / cache / reference. RB: 66: In 'call!' ... by / 2.0.0 / gem / rack-cache -1.2 / lib / rack / cache / reference. `Call 'in RB: 51: / 2.0.0 / Gemstone / Unicorn- 4.6.3 / Leib / Unicorn / Http_server.rb: 552: In' process_client '... icorn-worker-killer-0.4.2 In the 'process_client' ... / 2.0 / 2.0 / ... Gems / Unicorn- 4.6.3 / lib / Unicorn / http_server.rb: 632: 'worker_loop' in ... by / 2.0.0 / gemstone / unicorn- 4.6.3 / lib / unicorn / http_server.rb: 500: ` In 'spawn_missing_workers' ... by / 2.0.0 / gemstone / Unicorn- 4.6.3 / lib / Unicorn / http_server.rb: 142: `Initiate'  

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

OK, I have config.middlewa Re.delete removed "rack :: lock" Around a week ago and all are working fine. The error has ended and there is no problem removing rack :: lock.


java - sending data from android to mysql database -


Hi im trying to send data from Android device to mysql database. IM phones and laptops are connected to the internet through WiFi My phone is connected to a laptop via USB cable. I am not using emulator. In my Java code I use my 10.0.0.2 and 127.0.0.1 Tried to do or did any work. I have read something on the stack overflow and I understand that they only work on the emulator when I input some data into the app and click on send button, it says that the data was successfully entered and no An error was not registered, but when I check the database, there is no entry. I think the im or my linker.php file is located in the wrong location using the wrong address, then I tried to use my IP ADDRESS. I have main activity in my java code.

  http post httpPost = new HttpPost ("http: // 'IP address / linker.php");  

I changed the Apache http.config, so now its line is

  'Listen to IP address'  
< P> I have internet permissions in the manifest.

  & lt; Use-permission Android: name = "android.permission.INTERNET" & gt; & Lt; / Usage-permission & gt;  

This is my linker.php which is located inside of my HT docs folder

   

In the browser, I linker.php I open the file, I see it. I should check this before I fix it.

  Notice: Undefined index: In Name C: \ xampp \ htdocs \ linker. Notice on php line 6: Undefined index: C: \ xampp \ htdocs \ Linker.php at line  

Any help would be greatly appreciated.

OK, okay? It seems that $ '_POST does not have' name 'and' age '. I have to make a print_a ($ _ POST) as the first acting statement, to see what $ _POST is included ...

Second, the query is a bit far away ... Try

  mysql_query ("Insert in mytable (name, age) value ('$ name', '$ age')") ;  

javascript - I'm grouping <li> elements by class, based on a solution, but need help understanding how it works -


एक unordered सूची की कल्पना करें:

  & lt; ul id = "something" & gt; & Lt; li वर्ग = "अभिभावक" & gt; अभिभावक & lt; / li & gt; & Lt; li वर्ग = "अभिभावक" & gt; अभिभावक & lt; / li & gt; & Lt; li वर्ग = "बाल" & gt; बाल & lt; / li & gt; & Lt; li वर्ग = "बाल" & gt; बाल & lt; / li & gt; & Lt; li वर्ग = "अभिभावक" & gt; अभिभावक & lt; / li & gt; & Lt; li वर्ग = "अभिभावक" & gt; अभिभावक & lt; / li & gt; & Lt; li वर्ग = "बाल" & gt; बाल & lt; / li & gt; & Lt; li वर्ग = "बाल" & gt; बाल & lt; / li & gt; & Lt; / ul & gt;  

मैं उपर्युक्त उदाहरण को इसमें बदलना चाहता हूं:

  & lt; ul id = "something" & gt; & Lt; li वर्ग = "अभिभावक" & gt; अभिभावक & lt; / li & gt; & Lt; li वर्ग = "अभिभावक" & gt; अभिभावक & lt; / li & gt; & LT; ul & gt; & Lt; li वर्ग = "बाल" & gt; बाल & lt; / li & gt; & Lt; li वर्ग = "बाल" & gt; बाल & lt; / li & gt; & Lt; / ul & gt; & Lt; li वर्ग = "अभिभावक" & gt; अभिभावक & lt; / li & gt; & Lt; li वर्ग = "अभिभावक" & gt; अभिभावक & lt; / li & gt; & LT; ul & gt; & Lt; li वर्ग = "बाल" & gt; बाल & lt; / li & gt; & Lt; li वर्ग = "बाल" & gt; बाल & lt; / li & gt; & Lt; / ul & gt; & Lt; / ul & gt;  

मैंने यहां पाया समाधान के आधार पर यह सफलतापूर्वक किया है:

  $ ('# कुछ')। बच्चों ('li.child: नहीं (Li.child + li.child) ')। प्रत्येक (फ़ंक्शन () {$ (यह) .nextUntil (' li.parent ') और स्वयं ()। लपेटो (' & lt; ul / & gt; ');}) ;  

अगर मैं इसका उपयोग नहीं करता हूं: नहीं (चयनकर्ता + चयनकर्ता) यह अजीब निरंतर एम्बेडिंग का कारण होता है ul> li> ul> li, आदि।

तो मूल रूप से मैं सिर्फ इसे स्पष्ट रूप से समझना चाहता हूं।

कार्य

यह कोड का वर्णन करता है कदम से कदम यह क्या करता है

यह पहला बच्चा चुनता है, और उनमें से प्रत्येक के लिए, अपने सभी भाइयों को इकट्ठा करके अगले माता पिता को स्वयं सहित, और उस संग्रह को ul में लपेटें।

या:

एनोटेड

$ ('li.child: नहीं (li.child + li.child)') < / /> हर पहले बच्चे को चुनता है (एक बच्चा जो किसी अन्य बच्चे से नहीं चल रहा है)।

उनमें से प्रत्येक के लिए ( .each (function () {), इसके सब इकट्ठा करें भावी बहन ( और स्वयं ) सहित अगले माता-पिता ( अगली युग में ('li.parent') ), और उस संग्रह को एक ul में लपेटें ( wrapAll ('& lt; ul & gt;') )।

नहीं (बच्चे + बच्चे) और अगले तक

इसलिए जादू नहीं (li.child + li.child) के संयोजन में है (जो प्रत्येक 'समूह' का पहला बच्चा चुनता है), और अगलीअंत तक विधि (जो चयन करता है अगले माता-पिता तक के बाद के सभी बच्चे)।

यदि आप नहीं हटाते हैं (.. .. .. ..) , आप सभी बच्चों को मिलेगा और उनके बाद के भाई बहन, जिसके परिणामस्वरूप ओवरलैपिंग ग्रुप होते हैं जो सभी लिपटे होते हैं। यह आपके HTML को गंभीरता से खराब करता है।

अन्य प्रासंगिक अंतर

आपके संस्करण और दान ए के संस्करण के बीच में कुछ छोटे अंतर हैं:

सबसे पहले, वह केवल एक ही वर्ग के साथ काम करता है, क्योंकि वह चयनकर्ता के रूप में नहीं (li.child) का उपयोग करता है, इसलिए मूल रूप से जो कोई भी बच्चा नहीं है वह माता-पिता को माना जाता है

दूसरे, वह इसे & lt; li & gt; & lt; ul & gt; के बजाय बस & lt; ul & gt; के रूप में लपेटता है। यह समझ में आता है, क्योंकि आइटम पहले से ही एक सूची में हैं माता-पिता सूची को वैध रखने के लिए बच्चों के संग्रह को एक li में लपेटा जाना चाहिए li के अलावा अन्य तत्व ul तत्वों के प्रत्यक्ष बच्चों के रूप में मान्य नहीं हैं आपका कोड माता-पिता ul के अंदर एक ul डालता है, तकनीकी रूप से HTML अवैध बना रहा है ब्राउज़र संभवत: निहित li को जोड़कर यह आपके लिए ठीक कर देगा।


javascript - window.location.href not working on my form -


मैं एक ऐसा वेब ऐप बनाता हूं जो इस तरह दिखता है:

जब मैं रन मॉडल पर क्लिक करता हूं, तो मैं चाहता हूं कि फ़ॉर्म:" डैशबोर्ड ", खुल जाएगा।

जेएस कोड :

  & lt; स्क्रिप्ट & gt; Window.onload = function () {function newDoc () {window.location.href ("#http: //127.0.0.1: 8100 / # डैशबोर्ड"); }} & Lt; / script & gt;  

जब onClick पर "चलाएँ मॉडल" बटन फ़ंक्शन को सक्रिय करता है: newDoc ()।

समस्या यह है: मेरे यूआरएल पथ में लिखा है: लेकिन ' डैशबोर्ड का प्रपत्र लॉग नहीं है यह एक ही पृष्ठ में रहता है।

मुझे क्या करना चाहिए?

Window.location.href कोई तरीका नहीं है, यह एक संपत्ति है।

इसके बजाए इसे निर्दिष्ट करने का प्रयास करें (यह भी ध्यान दें, मैंने अग्रणी # वर्ण निकाल दिया है) .. ।

  window.location.href = "http://127.0.0.1:8100/#dashboard";  

आपको अपने फ़ंक्शन को window.onload ईवेंट से बाहर ले जाने की आवश्यकता है ...

  विंडो। Onload = function () {} फ़ंक्शन newDoc () {window.location.href = "http://127.0.0.1:8100/#dashboard"; }  

आम तौर पर केवल तब ही आवश्यक होता है जब आप पेज पर विशिष्ट तत्वों के साथ काम कर रहे होते हैं जो पृष्ठ तक लोड हो रहा है जब तक कि यह उपलब्ध नहीं होगा ।

newDoc को ओनलोड घटना में डालकर, आप प्रभावी ढंग से इसे अन्य घटनाओं से प्रत्यक्ष रूप से उपयोग किए जाने से छुपा रहे थे।


c# - Change the cell value (label) of a gridview with javascript, how to make the new value available in postback? -


I have a gridview with some templatefilld (label), and I have some control that will change the text of the label (with Jquery), except for the new value all functions are available, such as posting back like a post, I keep the original values ​​of the cell, I have to update backend to make aware of the change in the DOM (via jquery)? Thanks

foreach (Gridview line row in GVRRO) {decimal value = decimal Purse ((labeled) row.fund control ("labeled id").) Text); }


graph - Android GraphView Gradel Error -


I need to make more graphs in my app and I think importing the library is (thought).

I just follow the rules and I add the compilation line of Gradle

This is the reason:.

  apply plugin: 'com.android.application' Android {compileSdkVersion 21 buildToolsVersion "21.1.1" Default Config {applicationId "com.btc.btcmobile" minSdkVersion 17 targetSdkVersion 21 Snskrnkod 1 Snskrnnam "1.0 "} buildTypes {release {minifyEnabled false proguardFiles getDefaultProguardFile ( 'proguard-android.txt'), 'proguard-rules.pro'}}} {dependency file compilation: ( 'dir:' libs', including: [* .jar ']) Compilation' com.android.support:appcompat-v7:21.0.3 'compile' com.jjoe64: article: 4.0 .0 '}  

After that, Copy-pasting the example on the site, but when I compile, Can see I:

Error: Execution

com.android.ide.common.internal.LoggedErrorException 'dexDebug: App': n failed to act. C: Failed to run command \ Users \ Valerio \ AppData \ Local \ Android \ Sdk2 \ build-tools \ 21.1.1 \ dx.bat --dex --no-optimize --output C: \ user \ valerio \ Desktop \ BtcMobile \ btcmobile \ app \ build \ intermediates \ dex \ debug --input -List = C: \ Users \ Valerio \ Desktop \ btcMobile \ btcmobile \ apps \ Construction \ intermediate \ tmp \ Dax \ debug \ inputList.txt error code : 2 Output: Unexpected top-level exception: com.android.dex.DexException: multiple deck files define Lcom / jjoe64 / graphview / BuildConfig; com.android.dx.merge.DexMerger.readSortableTypes (DexMerger.java:596) on com.android.dx.merge.DexMerger.getSortedTypes (DexMerger.java:554) on com.android.dx.merge.DexMerger.mergeClassDefs on com.android.dx.merge.DexMerger.merge (DexMerger.java:189) on com.android.dx.merge.DexMerger.mergeDexes (DexMerger.java:171) (DexMerger.java:535) on com.android. On dx.command.dexer.Main.mergeLibraryDexBuffers com.android.dx.command.dexer.Main.runMonoDex (Main.java:302) (Main.java:454) on com.android.dx.command.dexer.Main. Run on com.android.dx.command.dexer.Main.Main (main.java, 1414) com.android.dx.com (Main.Java Month 45). Main. MAIN (Main.Java 109) UNEXPECTED TOP-LEVEL EXCEPT:

How can I solve?

Thank you.

In my case, I inside the Libs folder, GraphView4.1.jar I had compilation 'com.jjoe64: graphview: 4.0.1' in build.gradle. As soon as I removed the jar file from the Libs folder, the com.android.dex.DexException error was solved.


css - Media query doesn't update in rotating for iphone 4 and iphone 5s -


CSS is not updated in the media query when I rotate the iPhone 4 and the iPhone 5 between the picture and the landscape

/ P>

Since I use the viewport measurements, VWs and VHs in the media queries CSS, I hope they re-apply to rotate between portrait and landscape - all except the iPhone 4 and iPhone 5s Work perfectly fine in the phone. When I rotate from the picture to the landscape, the width of the image is also made in the landscape.

I do not understand that only iPhone 4 and iPhone 5 have the same problem. Can I have some problems in my CSS?

[edit] The pieces of code are below:

  @ media only screen and (min-device-width: 320px) and (max-device-width: 640 Px) {... .products .product INO {width: 80vw; Margin: 0 0 0 0; I when the 80th version has the same width to rotate from portrait to landscape in the iPhone 4. In the scenario, the physical width of page 80vw does not change, can I get any help for this?   

Here are some good examples

  / * iPhone 4 (landscape) ----------- * / @ Media only screen and (minimum-device-width: 320px) and (max-device-width: 480px) and (Orientation: scenario) and (- Webkit-min-device-pixel-ratio: 2) {/ * Styles * /} / * iPhone 4 (images) ----------- * @ @ Media only screen and (min-device-width : 320px) and (max-device-width (480px) and (Orientation: Portrait) and (-webkit-min-device-pixel-ratio: 2) {/ * Styles * /} / * iPhone 5 (Landscape) ----------- * / @ Media only screen and (Min-Device-width: 320px) and (Maximum device-height: 568 pixels) and (Orientation: Scenario) and (-webkit-device-pixel-ratio: 2) {/ * Styles * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * (Orientation: Portrait) and (-webkit-device-pixel-ratio: 2) {/ * Styles * /} / * iPhone 6 (Land Skep) --- -------- * / @ Media only screen and (minimum-device-width: 375 px) and (maximum device-height: 667 px) and (Orientation: scenario) and (-bbkit -Divise-pixel-ratio: 2) {/ * Styles * /} / * iPhone 6 (Picture) ----------- * / @ Media only screen and (Min-Device-width: 375px ) And (Maximum device-height: 667 px) and (Orientation: Portrait) and (-webkit-device-pixel-ratio: 2) {/ * Styles * /} / * iPhone 6+ (Landscape) ----- ------ * / @ Media only screen (Minimum-device-width: 414px) and (max-device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2) {/ * styles} IPhone 6+ (images) ----------- * @ @ Media only screen and (minimum-device-width: 414px) and (Maximum device-height: 736px) and (Orientation: Picture) And (-webkit-device-pixel-ratio: 2) {/ * Styles * /}  


android - How do I know if there is a navigation bar? -


Navigation bar is drawn on top of my activity with transparency so that my content can be viewed through the navigation bar. It's fine and I like it. However, there are two types of devices:

  1. Devices with a transparent navigation bar
  2. Device with hardware navigation bar (like some Samsung models) that include content, courses, Not drawn behind the navigation bar.

How do I know that the way my app is running is type 1 above? To wit. How can I get a semi-transparent navigation bar at the top of my program, "How can I put the" top of my activity "answer?

You can try to do something like this:

  Boolean menu menu = view configuration (reference) .hasPermanentMenuKey (); Boolean has a back key = keychart map.Device Husky (KEVENT.KKO_back); If you want to do this tool (there is a navigation bar in it!)  
(if you want to! Hemenuke & amp;!

java - maven / eclipse: add tomcat support to imported project -


मैंने maven- सक्षम गिथूब प्रोजेक्ट को एक्लिप्स में आयात किया, m2eclipse और आयात- & gt; "एसएमएम से मैवेन परियोजनाओं की जांच करें " कार्रवाई।

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

इस प्रोजेक्ट के लिए टोमैक समर्थन जोड़ने का सही तरीका क्या है मेवेन एकीकरण को छोड़कर (मैंने पहलुओं को बदलने कार्रवाई की, लेकिन मुझे नहीं लगता कि यह सही जाने का सही तरीका है)?

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

हालांकि एम्बेडेड सर्वर के लिए या जैसे उपलब्ध प्लगइन हैं

यह भी उपलब्ध है जैसे दूरस्थ सर्वर पर तैनात

ध्यान दें कि मैं केवल स्थानीय परिनियोजन प्लग इन का उपयोग करता हूं और न ही किसी के बाद के बारे में कैसे पता है।


c# - How do I prevent a redirect loop when using SessionExpireFilterAttribute to catch session timeouts? -


Again, I am new to MVC, so please be easy on me. When the session expires, I need to redirect the user to the login page. I found a way to do this by overloading the session ExpireFilterAttribute class, but my site was caught in a redirect loop. It is not enough to know about MVC, what is happening. Can someone explain a redirect loop to stop?

The main page I am using as a template, but I have also searched Staxwell Flow and have seen many pages including.

This page seems to be the closest to my problem, but I mentioned that solution (session session to take session accessifter for different controller), but he did not help me.

Here is a code Hold a session timeout This is in a file that is in a folder named FilterConfig.cs App_Start:

  Public Category FilterConfig {Public Static Zero Register Global Filter (GlobalFilterCollection Filters) {filters.Add (New HandleErrorAttribute ()); Filter. Add (New Season ExpireFilterAttribute ()); }} Public class session ExpireFilterAttribute: Akshnfiltr Aetribet {public override void Onakshnakshiring (action Aksepting Contact Filter Kantaks) {Actiteepitiantititititisiaks = Actiteepisionekt. On; // Check if the session is supported (ctx session! = Null) {// Check that if a new session ID is generated (ctx.Session.IsNewSession) {// If it says it is a new Session, but if an existing session cookie is present, it should be // string session has expired cookie = ctx.Request.Headers ["cookie"]; (If (null! = Session cookie) & amp; (session cookies. Index ( "ASP. NET_SessionId")> gt; = 0 & amp; session cookies! = "Reset")) {ctx.Response.Redirect ( " ~ / Admin / log in "); }} Base.OnActionExecuting (filterContext); }}}  

Then I have this code, which is called ErrorController.cs. I also tried to do this in AdminController.cs, but I took it to a different controller on the log method. Public class error controller: Administrator {[Sensexerfilter] Public ActionSecult Index 2 () {// This method will not execute that our session has expired / render Home page View refund (); }}

Then there is the login method. When this is the "Return View" part when it is in AdminController.cs, this session goes on ExpireFilterAttribute.

  public proceedings login () (if (Session [ "AdminUserName"] = null) {redirect return ( "Index");} ModelAdminLogin obj_MAL = new ModelAdminLogin (); Session [ "Captcha "] = Claintatiliti. GenerateRandomCode (); session [" Arrom "] = null; if ((request. cookies [" ADMINUSERNAME "]! = null) & amp; amp; amp; and (requests. cookies [" Adminward "] = nULL)) {obj_MAL.UserName = ClientUtility.DecryptString (request. cookies [ "ADMINUSERNAME"] .Value); Obj_MAL.Password = ClientUtility.DecryptString (request. cookies [ "Adminford"]. value); Obj_MAL.RememberMe = true Return View (obj_MAL);} and { Exclamation view (obj_MAL);}}  

To summarize, when a session expires, the site session calls ExpireFilterAttribute.OnActionExecuting (required) which see the redirected as admin / login (desired), but appears to the user before the page, this session ExpireFilterAttribute.OnActionExecuting start loop which then calls. finally, I get the error message "this site There is a redirect loop. " When a session is over, I need a way to redirect to the login page and after coming to the login screen it will not have to go back to the session-before filter attribute class.

I would appreciate it for any help. Thank you.

I suspect that you are also putting attribute on login action, which is causing the loop to login Use the Allow Allow attribute on the Action:

  [AllowAnonymous] Public Function Logins () {}  

python - how to run simple script via web instead of a executable file -


I am trying to use a python without any ordinary program.

Some errors are taking place while doing this

Still, I was thinking that it would upload the program anywhere on the Web, hence, anyone with the link can use it in a very easy and practical way .

Does anyone know how I can accomplish this?

  1. If you want to download someone, use your file command :

      Python -M SimpleHTTserver  

    on your file diary.

  2. If you want to execute something in Python script, use a small web service flask:

  3. Flask app = flask from flask import (__name__ ) @Apps Root ('/') Def hello_world (): # Return your dragon script to 'Hello World' here! If __name__ == '__main__': app.run ()

    Anyone else can use your script {yourIp}: 8000 with browser.

Except the code, you only need to use a server and a browser.


python - Save/load sympy lambdifed expressions -


Imagine the process of the following three steps:

  • I'm a big and somewhat Complex expression (this process takes a lot of time) using sympy to create
  • Use that expression in the lambda function by using sympy.lambdify (also slow) Is transformed.
  • The function has been evaluated (fast)

Ideally, steps 1 and 2 are done only once, while step 3 evaluated multiple times Will go Unfortunately, the evaluation of step 3 spread over time (and different dragon sessions!)

I am looking for a way to save the "lambedefide" expression in the disk so that I can load them and I Unfortunately, pickle does not support lambda functions at one point after using it. In addition my lambda function is used.

I can definitely make and use it with a matching function, but it is fast disabling and error prone.

You can use "del", as told here

< P>

and

Import the dill and set the variable 'recursive' to "true" value.

  import dill dill.settings ['recurse'] = True  

Let's say that f is your longitude function. You can dump it to disk using the following disk.

  dill.dump (f, open ("myfile", "w"))  

After this you can load the function from the following line . It can also be done with another dragon script.

  f_new = dill.load (open ("myfile"))  

node.js - Multitask in GulpJS -


How are you guys?

How do I create similar things in GulpJS which are Gruggs? possible?

Example:

  module.exports = function (grunt) {"strictly use" grunt.initConfig ({subjection: {options: {management: false}, Dev: {...}, prod: {...}}, less: {option: {cleancss: true}, dev: {...}, prod: {...}}}); Grunt.registerTask ("dev", ["uglify: dev", "less: dev"]); Grunt.registerTask ("prod", ["low: products", "low: products"]); }  

Thanks!

I believe that is what you are looking for, how to run tasks in a series Here's how to do this:

  var gulp = need ('gulp'); // takes a callback so that the engine will know when this work will be done when gulp.task ('one', function (CB) {// do stuff - async or otherwise CB (mistake); // If the fault tap And not undefined, the orchestration will stop, and 'two' will not run}); // must be completed before recognizing a dependent work gulp.task starts ('two', ['a'], function () {// task 'one' is done now}); Gulp.task ('default', ['one', 'two']); // Optionally: gulp.task ('default', ['' two ']);  

You can read more about this here:


collections - JPA How to filter ManyToMany relationship -


I try to learn how to filter this relationship:

  EntityA {@ManyToMany Collections (target entities = roll.class) collection & lt; Role & gt; role; } Users {@ManyToMany (target = role.class) collection & lt; Role & gt; role; }  

What I try to achieve is something like RBAC. Entity should be accessible from some (multiple) roles. A user also has fixed (multiple) roles.

How can I return only the Entity Rows for a specific user? All EntityA rows which mean that there are equal roles in the form of a user?

It means only two collections (the role of Antitaya which plays a role from the user) Is it possible that a prediction?


php - The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method -


Amazon Web Services Suite to test the API request came back with the following error:

  & lt; ItemSearchErrorResponse xmlns = "http://ecs.amazonaws.com/doc/2005-10-05/" & gt; & Lt; Error & gt; & Lt; Code & gt; SignatureDoesNotMatch & lt; / Code & gt; & Lt; Message & gt; The signature we have requested does not match the signature you provided. Check your AdWords secret access key and signing method. Consult the service documentation for details. / Messages & gt; & Lt; / Error & gt; & Lt; RequestId> Ebe90459-1abd-403e-bfec-6916ebe07e1f & lt; / RequestId> & Lt; / ItemSearchErrorResponse & gt;  

Here's how I arrived at:

  & lt; Php $ private_key = "XXXXXXXXXXXXXXXXXXXXXX"; $ Date = urlencode (date ('Y-M-D' TH: i: sz / z ', time ())); $ String_to_sign = "get webservices.amazon.com / onca / xml / AWSAccessKeyId = XXXXXXXXXXXXXXXXXXXXXXXA & amp; keyword = Rocket & amp; Operation = ItemSearch & amp; SearchIndex = Toys & amp; Service = AWSECommerceService & amp; timestamp =" .. $ Date ""; $ Sign = urlencode (base64_encode (hash_aemac ("sha256", $ string_to_sign, $ private_key, true))); $ Url = "Actiteepi://vebsserviseskameznkcom/onka/kml?awsksesskeyid=ksksksksksksksksksksksksksksksksksksksksksksksks∓kiwards=raket∓opreshn=itemsearc∓searcindeks=toyj∓srvis=avsekommersesservis∓timstmp="k$detk"∓signecr= ". $ Sign. ""; Header ("Location:". $ Url. ""); ? & Gt;  

I've basically had url (so to direct a signed RET request header function) but I stuck with the error I doubled your access ID and secret key, so I Know that they are not going to cause problems. Does it produce signals correctly?

It seems you are trying to use a V2 calling the rest of the AWS API Please complete the signature for.

I bet the problem Signature Edition , Signature Method and version first-string signature signing in absentia Fifth step and examples of the documents shown above the string to be done:

Obtain. Elasticmapreduce.amazonaws.com \ n / \ n AWSAccessKeyId = AKIAIOSFODNN7EXAMPLE and action = Varnnjobflo and signature method = HmacSHA256 and Hstakshrvivrn = 2 and timestamp = 2011-10-03 T 15% 3A% 19 3A 30 and above = 2009-03- 31

spring - Can I define the target table for int-jdbc:outbound-channel-adapter based on the received message? -


I Spring Integration JDBC support for continuing the message in one of the many tables (> 20) on the basis of a certain condition (As stored in the "Table" message header):

  & lt; Integer: Channel ID = "cmTablesJdbcChannel" & gt; & Lt; / Integer: channel & gt; & Lt; Puarnank- JDBC: outbound channel adapter channel = "cmTablesJdbcChannel" id = "cmTableJdbcOutputAdaptor" Data Source = "data source" query = "TABLE_NAME values ​​(int_id, parent_int_id, name) (insert values: headers [int_id],: headers [ Parent_int_id],: header [name]) "& gt; & Lt; / Integer-JDBC: Outbound channel-optimizer & gt;  

I have tried to change the TABLE_NAME many houses but no one did not work:

  $ {headers [ 'table']} # {header [ 'table']} [headers [table]}  

I am trying to avoid the use of 20 different outbound channel adapter and use a single again, But the name of the dynamic table was used to establish. Do you know that this is possible?

There were similar questions, but the parameters used are:

No, it does not work anymore and can not be in the form of the TABLE_NAME parameter.

issue feel free to take such as query expression to Insert / Update SQL at runtime against the request message.

Meanwhile, you should use NamedParameterJdbcTemplate to be used some custom & lt; Outbound channel-optimizer & gt; Or like a complex expression:

  & lt; Service-catalytic input channel = "cmTablesJdbcChannel" output channel = "nullChannel" expression = "@ jdbcTemplate.update (+ headers.table + 'inserted') (int_id, parent_int_id, name) values ​​(: int_id, parent_int_id ,: name ) ', Header) "/>  

Note, do not create SQL Expressions directly with parameter values. parametrized with version: : The best way for any RDBMS will be to compile it on server side (indexed, query scheme etc.) and reuse all other upcoming hangouts Will be done.


javascript - alert() and confirm() not showing on parent of iframe -


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

page1.php:

  & lt; html & gt; ... स्रोत ... & lt; iframe src = "page2.php" / & gt; ... अधिक स्रोत ... & lt; / html & gt;  

page2.php

  & lt; html & gt; & lt; स्क्रिप्ट & gt; फ़ंक्शन मायफंक () {window.confirm ('....') ... अधिक स्रोत} & lt; / script & gt; & lt; / html & gt;   

जब भी मैं page2 के साथ काम कर रहा हूं, यह पुष्टि (अलर्ट) विंडो को प्रदर्शित करता है जैसा कि यह चाहिए, हालांकि इसे पेज 1 से खोलते हैं और यह iframe में प्रदर्शित होता है , यह दिखाई नहीं देता मैंने window.parent.window.confirm / alert के साथ भी कोशिश की, लेकिन कोई पासा नहीं है, इसलिए मुझे लगता है कि मैं यहाँ कुछ और खो रहा हूं। इसलिए मेरा प्रश्न यह है कि यह सुनिश्चित करने के लिए कि हमारे iframed पृष्ठ से एक स्थानीय जेएस फ़ंक्शन को बुलाए जाने से कैसे माता-पिता पर भी दिखाई देगा?

अरे, मुझे बिल्ली के रूप में गूंगा लगता है - मेरे पाठ तत्वों को भी चुनने में सक्षम नहीं होने के कारण मुझे एहसास हुआ कि मेरे पास एक डिज़ाइन पर जेड इंडेक्स था Irame @ -1 में रखा गया है, जो इसे बनाया है unselectable। एक बार फिक्सिंग कि मुद्दा हल हो गया था। उनकी टिप्पणियों और मदद के लिए सभी को थक्स!


java - How can I open Preference screen by long press from a key of sample keyboard? -


I'm starting Java and Android, I'm learning about sample softkeyboards in Android studio. I want to know how to set the preferences screen for long press on a key of the sample keyboard (like the globe) rather than setting the menu of my phone. Sorry for my bad english

The way you can open the preferences screen with a button

 < Click on Code> Public Zero (see V) {Switch (v.getId ()) {Case RID BTNPFRF: intention intended = new intent (priority .tov, prefacesivity class); StartActivity; break;  

The long click is something like

  btn.setOnLongClickListener (new on the CallClickListener) {@ Override Public Boolean on Longclick (see V) {// TODO Auto-Generated Method Stub Returns True;}});  

Converting xlsx, docx, pdf files as jpg images using PHP -


Is there any way to convert xlx, docx and pdf files into image (jpg) format using php? I need to read this file from a server and convert them to images and show them on the page.

Thanks in adv

If you want to achieve it, then you first Your XLSX or DockX has to be converted to PDF

The best way to do this is to install LibreOffice on your server.

Then use the headless command of libreoffice to convert to PDF

  shell_exec ('libreoffice --headless -convert- to pdf file toconvert.docx -outdir output / Path / for / pdf ');  

Then convert your PDF to jpg

  shell_exec ('/ usr / local / bin / myfile.pdf myfile.jpg');  

javascript - Regex check from a link -


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

  • 6 उत्तर

मेरे पास एक लिंक है

  डैशबोर्ड / अनुमतियाँ? पृष्ठ = 2  

इसलिए जावास्क्रिप्ट में मैं यह जांचना चाहता हूं कि क्या इस लिंक की अंतिम "? Page = 2" है या नहीं

यदि इसे हटा दिया गया है तो

नोट: यहां? पृष्ठ = 2 2 अस्थिर है

तो इसे जावास्क्रिप्ट में कैसे करें

  var testStr = document.URL; Console.log (testStr.match (/ \? पृष्ठ = \ d + /)! == नल);  

doxygen - ingroup a whole file including members? -


How do I define all the functions, squares, etc. of a file?

Example file:

  / *! * \ File * \ ingroup myGroup * / / *! * It's my job * / int muffin ();  

Now, if you look at the output, then the file is added to that group only, there is no function. I have to add \ ingroup myGroup to that file to add that file. Can this be done in parentheses {} or any other way?

By the way:

  / *! * \ File * This is my testfile * \ ingroup unitname * \ addtogroup UnitName * \ {* / / *! * It's my job * / int muffin (); / *! \} * /  

This generates the desired output file and the function is properly added.

This does not work with \ ingroup . This puts the function in the File section (I upgrade to the latest version of doxygen with the same result.


javascript - Calling AngularJS function inside jQuery -


I am calling an AngularJS function inside a jQuery function, but the execution is not sequential. When I execute this page, jQuery warns before warning AngularJS instead of warning. How can I confirm that the AngualarJS function is executed? After performing the AngularJS function, it should execute the next line on jQuery.

Javascript function: -

  (function ($) {$ .fn.multipleInput = function () {Return this.each (function () {angular.element ( '# TheController'). Scope.getFullName ($ input.val ()); Warning ("ANGULAR JS");}});  

Angulose Function: -

bipin.controller ('Controller', ['$ Scope', '$ q', '' '$ Http', '$ window', function ($ radius, $ q, $ http, $ window) {$ scope.selected = ''; $ scope.email = ''; $ Scope.fullName = ''; $ Scope.getFullName = function (item) {warning (); return $ http.get ('https: // myservice / v1 / query /' + $ label). Then (function (response) {return response.data.items. Map (Function (item) {warning ("INSDE ANGULAR JS"); $ scope.fullName = item.fullName; come back m.fullName;});});}; $ http.get asynchronous , Because

When you say it, it gives a promise and jquery function The execution continues. When the .then function is executed from http call server and when the alert is displayed in it, but as Tony Barnes said, I think you can apply it to a pure angle. There is no need to mix two.


html5 - Problems with sec:autorize + thymeleaf -


I think I'm getting close to the solution, but still I'm stocking it on. I change some things in code and this is the actual code:

   & Lt; Ul id = "topMenu" & gt; & Lt; Li th: each = "menuIntext: $ {@menmenu.getmenuitem ()}" & gt; & Lt; Div & gt; & Lt; "Th: $ {menuItem.getLabel ()}" th: href = Gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Ul class = "topSubMenu" th: if = "$ {menuItem.getSubItems ()}! = Null" & gt; & Lt; Li: each = "sub menu: $ {menuItem.getSubItems ()}" th: class = "$ {subMenu.getSubItems ()}! = Tap? 'Hpit-topCategory'" gt; & Lt; Div & gt; & Lt; A th: text = "$ {subMenu.getLabel ()}" th: href = "$ {subMenu.getUrl ()}" style = "display: block" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Ul class = "topSubMenu" th: if = "$ {subMenu.getSubItems ()}! = Null" & gt; & Lt; Li th: each = "sub-category: $ {subMenu.getSubItems ()}" & gt; & Lt; Div & gt; & Lt; A th: text = "$ {subCategory.getLabel ()}" th: href = "$ {subCategory.getUrl ()}" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Neo & gt;  

I used a user:

  & lt; Username = "David-gh" password = "p" authorization = "ROLE_USER, ROLE_ADMIN, ROLE_BLAH" / & gt;  

and other users:

  & lt; User Name = "david-gh2" password = "p" Officials = "ROLE_USER, ROLE_ADMIN" />  

Loading menu:

  bean square = "web.data.MenuItem" & gt; & Lt; Constructor-arg value = "home" /> & Lt; Constructor-arg value = "/" /> & Lt; Constructor-arg value = "ROLE_USER" /> & Lt; / Bean & gt; & Lt; Bean class = "web.data.MenuItem" & gt; & Lt; Constructor-arg value = "evaluation" /> & Lt; Constructor-arg value = "###" /> & Lt; Constructor-arg value = "ROLE_BLAH" /> & Lt; Manufacturer-Arg & gt; & Lt; List & gt; & Lt; Bean class = "web.data.MenuItem" & gt; & Lt; Constructor-arg value = "new evaluation request" /> & Lt; Constructor-arg value = "/ requestClient" /> & Lt; Constructor-arg value = "ROLE_USER" /> & Lt; / Bean & gt; & Lt; / List & gt; & Lt; / Creator-arg & gt; & Lt; / Bean & gt;  

So all such behavior should be seen with: David-gh , but should not see evaluation from david-gh2 . For now I am seeing both things, so I guess the command line:

   

This is not working as it does not work as th: sec: authorize = "$ {hasAnyRole (menuItem.getRoles ())}" May be done.

Can someone give me a hand ???

So I fix my own problem and the answer is that there is a bug in thymeleaf which is a class Inside information does not correct. I look at this solution to fix this:

  & lt; Div: if = "$ {# authorization.expression ('hasAnyRole (' '__ $ {menuItem.getRoles ()} __' ')')}" & gt;  

This is not really a good thing but do work for now :)


sql - Generate random date for some period -


I have a temporary table with the rate and duration in my database:

  rate | Period ----- + -------- 3 | Week 1 Month 2 Month 1 Week 3 || Year 1 | Mon 1 Month 1 Month 1 Month 1 Month 1 Month 6 | Year 2 | Month  

I need to generate random dates for 2014. For example, there should be 6 random dates for '6 years' 2014 year. There should be a random date for 1 week 2014 in each week. Can anyone help me?

So, this is my work, but the dates are not nearly perfect, maybe anyone can get an error? Generate GenerateTat (@ Date from date, @ Rate Int, Period Navarrek (50)) Start @ Almost Table (Item Date) DECLARE @i int, @j Integer, @d Integer @date date This declaration (@Pyiod as 'Y%') set start @ I = 0 while (@i & LT; @Rate) SET @date = DATEADD (day, dbo.Amount (start 0364) ), @date_from) If @date (select * from LIST *) @LIST values ​​(@date) set @ i = @ I (@PiodEd like 'm%') start start +1 end END Start putting in ii = 1 WHILE (@ and & l T; = 12) BEGIN SET @ j = 0 SET @ d = matter @ when 2 am to 28 when 4 then 30 when 6 then 30 when 9 and 30 when 11 and 30 or so 31 end (@ j & lt; @Rate) BEGIN SETI @ date = DATEADD (day, dbo.Amount (0, @ d-1), @date_from) If @date not (choose from LIST * @) @LIST start setting values ​​(@date) @ j = J + 1 END END set @date_from = DATEADD (month, 1, @date_from) set @ i = @ I +1 end END (@ period% W @ 'like) BEGIN SET @i = 1 WHILE (@ and & lt ; = 52) BEGIN SET @ j = 0 WHILE (@JWLL; @Rate) Set start @date = DATEADD (day, dbo.Amount (0,6), @date_from) @date (choose from @LIST *) @LIST values ​​(@date) set to start @ j = J + 1 END END set @date_from = DATEADD (week, 1, @date_from) Set @ i = @ i + 1 END END Return end date Function amount (@AmountMin boat, @AmountMax boat) declared as @Amount as the start boat float = (select new_rand RandomNumbers) * (@ AmountMax- @ AmountMin) + @AmountMin see returns @Amount end GO RandomNumbers cast selected as the user (rand (eventually (NEWID ())) * 1000 INT) Visit new_rand in

To get 6 different dates in the year 2014, you can try something like below -

  announcement @ counter INT DECLARE @MaxDateInterval INT DECLARE @ Tapdet on DECLARE @ Noafdet INT DECLARE @ResultDatesForYr table (TmpDate DATE) set @ counter = 0 sET @ Noafdet = 6 sET @TmpDate = '2014-01-01' sET @MaxDateInterval = FLOOR ((365 - @ Noafdet) / @ Noafdet) WHILE (@ Counter & lt; @ Nofdet) Start SELECT @TMPDate = DATEADD (DAY, (SELECT (1 + FLOOR (@MaxDateInterval * RAND ()), to include @TMPDate in @ ResultDatesForYr (TmpDate) values ​​(@TpmDate) SET @Counter = @Counter select from +1 and * fROM @ result dots: en: Forer  

you can write functions that will not accept the necessary and year to date


javascript - How to use a JSON-like JQuery function? -


How can I use JSON-like variables in my function like this?

  $ Ajax ({type: "post", -> data: {this_var: this_value}});  

Use JSON.stringify () to create JSON objects.

  $ Ajax ({Type: "POST", url: url Action, Datatype: "Jason", Content Type: "Application / Jason", Data: JSON.stringify ({variable1: value1, variable2: value2})});  

Rails 4.1 Postgres String Arrays: Can't Save After Modifying -



Rails 4.1 Postgres String Arrays: Can't Save After Modifying -

weirdness:

i'm working in rails 4.1 postgres backend. 1 of models has array fields, i'm hoping handled 'pg' gem (0.17.1). migration file , resulting schema can found below.

the field in question string array. below, i've posted migration, resulting schema, , code doesn't seem working (along output when code run in rails console).

i don't have in user model references field.

migration:

add_column :users, :test, :string, :array => true, default: '{}'

schema:

t.string "test", default: [], array: true

here steps i'm using to reproduce in rails console (assuming basic user model has been created hold field):

u = user.first() u.test.push('testvalue') u # => #<user id: 1, name: "dave", passhash: nil, email: nil, created_at: "2014-10-04 10:12:29", updated_at: "2014-10-04 10:12:29", provider: "identity", uid: "1", oauth_token: nil, oauth_expires_at: nil, test: ["testvalue"]> u.save user.find(1).test # => []

so user record seems initialized -- has empty array set field -- , can array operations on it. somehow can't modifications stick.

fyi, able modify , save other fields using same procedure; it's just arrays behaving this.

any ideas?

edit:

u.test.push('newitem')returns new array expect. no sign of going wrong, or error validates_uniqueness_of -- see firing in console? first comment, i've tested using 'update':

u.update(test: [(u.test << 'testvalue')].flatten)

gives me behavior want, seems clumsy. there need alter in model? i'm not sure how i'm doing makes validates_uniqueness_of fire (it's not set in model).

there (at to the lowest degree used be) problem using ruby array operators push or << on activerecord fields. not marked dirty , not updated in database on save. seek this:

u = user.first() u.test_will_change! u.test.push('testvalue') u.save user.find(1).test

attribute_will_change! marks attribute dirty, making sure serialized , saved database on save.

ruby-on-rails arrays pg

Cannot move an R chart when generated from C# with RDotNet -



Cannot move an R chart when generated from C# with RDotNet -

i using next c# code inquire r generate series of random numbers , plot them histogram. code works , chart appears. problem cannot chart. impossible move or close it. if go end of code, disappears. there way create r chart flexible can move , other stuff it?

using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using rdotnet; namespace rgenrand { class programme { static void main(string[] args) { string dllpath = @"c:\program files\r\r-3.1.1\bin\i386\"; rengine.setdlldirectory(dllpath); rengine.createinstance("rdotnet"); rengine engine = rengine.getinstancefromid("rdotnet"); engine.initialize(); var x = engine.evaluate("x <- rnorm(100, mean=50, sd=10)").asnumeric(); engine.evaluate("hist(x)"); console.writeline(x); } } }

c# r visual-studio charts rdotnet

Windows Toolbar + Google Chrome: Display all tabs on hover -



Windows Toolbar + Google Chrome: Display all tabs on hover -

so i'm big fan of google chrome on windows 8.1, ie doesn't cutting me (popular sentiment believe...)

the advantage see in ie on chrome hover display on windows toolbar.

(sorry images windows 7...)

where on chrome 3 tabs open...

does know of way google chrome operate net explorer on toolbar?

maybe kind of chrome extension unaware of, knows! help, maybe can solve problem good!

google-chrome windows-8.1

asp.net mvc 4 - Cannot edit kendo grid after deploy the project on server -



asp.net mvc 4 - Cannot edit kendo grid after deploy the project on server -

i have gird, works while i'm working locally, when deploy code on server cannot edit anymore grid.

@(html.kendo().grid<bussinessunitdto>() .name("functionsgrid") .autobind(true) .scrollable() .toolbar(toolbar => { toolbar.create(); toolbar.save(); }) .editable(editable => editable.mode(grideditmode.incell).displaydeleteconfirmation(false)) .datasource(ds=>ds.ajax().batch(true).serveroperation(false) .read("getdeliveryunits","deliveryunits") .create("editing_create", "deliveryunits") .update("editing_update", "deliveryunits") .destroy("editing_destroy", "deliveryunits") .model(model => { model.id(m => m.unitid); }) ) .columns(c => { c.bound(e => e.unitname); c.command(com => com.destroy()); } ))

if i'm looking firebug example, see input editing cell not created. know why behaviour?

thank :)

asp.net-mvc-4 kendo-ui kendo-grid kendo-asp.net-mvc

smtp - Meteor Mailgun response to emails not going to "from" address -



smtp - Meteor Mailgun response to emails not going to "from" address -

i have next meteor code, meteor's default mailgun smtp settings:

email.send({ to: "customer@gmail.com, from: "company@gmail.com", replyto: "company@gmail.com", subject: 'test', text: "test" });

the email sends fine, when client clicks "reply" in gmail, replies "customer@gmail.com" instead of "company@gmail.com".

make sure you're not hitting "reply all" instead of "reply".

i have tested , it's working expected on end latest meteor , email module.

best,

meteor smtp mailgun

How to make rotation in XAML of one element by clicking on another one? -



How to make rotation in XAML of one element by clicking on another one? -

i have such code (cut part needed; code used usercontrol):

<grid> <image x:name="im" horizontalalignment="left" height="120" width="120"> <image.rendertransform> <rotatetransform angle="0" centerx="60" centery="60" /> </image.rendertransform> </image> <button x:name="br" content="right" width="55"> <button.triggers> <eventtrigger routedevent="mouseup"> <beginstoryboard> <storyboard> <doubleanimation storyboard.targetname="im" storyboard.targetproperty="rendertransform.angle" by="90" duration="0:0:1" /> </storyboard> </beginstoryboard> </eventtrigger> </button.triggers> </button> </grid>

i'd rotate image ("im") 90 degrees clicking "br" button. code doesn't work. if utilize code:

<grid> <image x:name="im" horizontalalignment="left" height="120" width="120"> <image.rendertransform> <rotatetransform angle="0" centerx="60" centery="60" /> </image.rendertransform> <image.triggers> <eventtrigger routedevent="mouseup"> <beginstoryboard> <storyboard> <doubleanimation storyboard.targetname="im" storyboard.targetproperty="rendertransform.angle" by="90" duration="0:0:1" /> </storyboard> </beginstoryboard> </eventtrigger> </image.triggers> </image> <button x:name="br" content="right" width="55"> </button> </grid>

rotation works (image rotating clicking on it). what's wrong first one?

did tried button.click routed event instead of mouseup. reason mouseup not working button explained here: wpf event not bubbling.

the code provided work on right button click of mouse. on left button click of mouse, click event swallowing mouse events.

i tried below code , seems work. have used dummy image source.

<grid> <grid.rowdefinitions> <rowdefinition></rowdefinition> <rowdefinition></rowdefinition> </grid.rowdefinitions> <image x:name="im" horizontalalignment="left" height="120" width="120" source="..\images\info.png"> <image.rendertransform> <rotatetransform angle="0" centerx="60" centery="60" /> </image.rendertransform> </image> <button x:name="br" grid.row="1" content="right" width="55"> <button.triggers> <eventtrigger routedevent="button.click"> <beginstoryboard> <storyboard> <doubleanimation storyboard.targetname="im" storyboard.targetproperty="rendertransform.angle" by="90" duration="0:0:1" /> </storyboard> </beginstoryboard> </eventtrigger> </button.triggers> </button> </grid>

let me know in case need more information.

xaml

windows - How to open file indicated in a .txt file and remove user defined start of the the line pattern -



windows - How to open file indicated in a .txt file and remove user defined start of the the line pattern -

for illustration have names.txt. when open file see 3 columns

name1.txt name2.txt name3.txt name4.txt name5.txt name6.txt *column2 can found in "c:\name\male" directory column3 can found in "c:\name\female" directory*

now, how can implememt in batch script?

first, when run batch script, column 2 , 3 files 1 editted user. want user have alternative line want remove filenames indicated in column2 , column3.

for example:

enter pattern want remove: peter

now, files in column2 , column3 of files.txt containing "peter" @ start of line removed.

here's code below.

for /f "tokens=2,3" %%a in (c:\name\files.txt) ( set /p line=enter pattern want remove: set line=!line:,=" /c:"! findstr /v /i /c:"!line!" "c:\name\male\%%b" > "c:\comp\male\%%b" findstr /v /i /c:"!line!" "c:\name\female\%%c" > "c:\comp\female\%%c" )

i cant working. everytime run batch file code creates new files indicated in files.txt 0 bytes size.

windows batch-file cmd

Cordova Windows Phone 8.1 upload file -



Cordova Windows Phone 8.1 upload file -

i'm writing application windows phone 8.1 , have problem. configured cordova , angularjs windows phone not work upload files using html tag.

i have in index.html:

class="lang-html prettyprint-override"><body ng-app="sample-app" ng-csp ng-controller="appcontroller" ng-file-drop="filesdropped($files)"> <h1>sample</h1> <small>{{model}}</small> <button ng-click="onclick()">scan</button> <br><br> <input type="file" multiple ng-file-select="filesdropped($files)">

the problem button upload doesn't work. in addiction html tag works on ios , android.

is there sensible solution?

thanks!

windows phone webview not back upwards feature. 1 alternative intercept change event of input, phone call cordova file picker illustrated here: http://stackoverflow.com/a/15872242/1104494

cordova windows-phone-8 windows-phone-8.1

objective c - How to go on a particular view when user is already logged in via Facebook in ios app? -



objective c - How to go on a particular view when user is already logged in via Facebook in ios app? -

i building app need facebook login integration.my app contain tour 4 images , facebook button login , i’m using storyboards.

i implemented facebook login.

i facing problem want when user login goes next view , after closing app when user opens app 1 time again should on next view not on tour screens.

i have tried segue, first user when logged in goes next view when user come after closing app user tour page 1 time again don't want,but happening right when user click on facebook button user able go next view.

this code:

- (void)viewdidload { [super viewdidload]; nsstring *verify_status = [[nsuserdefaults standarduserdefaults]stringforkey:@"verify_status"]; if ([verify_status isequaltostring:@"y"]) { _pageimages = @[@"playo.jpg", @"playo.jpg", @"playo.jpg", @"playo.jpg"]; self.pageviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:@"pageviewcontroller"]; self.pageviewcontroller.datasource = self; pagecontentviewcontroller *startingviewcontroller = [self viewcontrolleratindex:0]; nsarray *viewcontrollers = @[startingviewcontroller]; [self.pageviewcontroller setviewcontrollers:viewcontrollers direction:uipageviewcontrollernavigationdirectionforward animated:no completion:nil]; self.pageviewcontroller.view.frame = cgrectmake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 30); [self addchildviewcontroller:_pageviewcontroller]; [self.view addsubview:_pageviewcontroller.view]; [self.pageviewcontroller didmovetoparentviewcontroller:self]; } else { // nil } } - (ibaction)fblogin:(id)sender { [[fbrequest requestforme] startwithcompletionhandler:^(fbrequestconnection *connection, nsdictionary<fbgraphuser> *user, nserror *error) { if (error) { nslog(@"error:%@",user.objectid); } else { nsstring *usernamee; nslog(@"fb user first name:%@",user.first_name); usernamee=user.first_name; nslog(@"fb user lastly name:%@",user.last_name); nslog(@"fb user birthday:%@",user.birthday); nslog(@"fb user location:%@",user.location); nslog(@"fb user username:%@",user.username); nslog(@"fb user gender:%@",[user objectforkey:@"gender"]); nslog(@"email id:%@",[user objectforkey:@"email"]); nslog(@"location:%@", [nsstring stringwithformat:@"location: %@\n\n", user.location[@"name"]]); userimageurl = [nsstring stringwithformat:@"https://graph.facebook.com/%@/picture?type=large", [user objectid]]; nslog(@"image=%@",userimageurl); [self performseguewithidentifier:@"afterlogin" sender: self]; nsstring *verifystatus=@"y"; //for know logged in [[nsuserdefaults standarduserdefaults]setobject:verifystatus forkey:@"verify_status"]; [[nsuserdefaults standarduserdefaults] synchronize]; } }]; } - (void)logout { [fbsession.activesession closeandcleartokeninformation]; [[nsuserdefaults standarduserdefaults] removeobjectforkey:@"verify_status"]; // if u need utilize }

help appreciated!

ios objective-c facebook uiviewcontroller uistoryboardsegue

javascript - Creating a slide in div with jquery -



javascript - Creating a slide in div with jquery -

i trying create div 2 buttons. click first button , nother div slides in left. has button when clicked makes slide off screen. same sec button in main div. when sec button clicked div slides in right. 1 time again button makes slide off screen.

this done in jquery.

can tell me whats wrong here?

jquery:

var boxwidth = $("#port2").width(); $('#left').on('click',function(){ $('#port1').animate({left:'8'}); }); $('#right').on('click',function(){ $('#port2').animate({(right:'100%'-boxwidth}); }) $('#leftc').on('click',function(){ $('#port1').animate({right:'100%'}); }); $('#rightc').on('click',function(){ $('#port2').animate({left:'100%'}); });

html:

<div id="wrapper"> <div id="port1"> left text goes here <button id='leftc'>close 1</button> </div> <div id="port2"> right text goes here <button id='rightc'>close</button> </div> <div id="text"> stuff goes here <br /> <button id='left'>left</button> <br /> <button id='right'>right</button> </div> </div>

css

#text{ width:500px; height:200px; background-color:red; font-weight:bold; font-size:1.2em; padding:25px; } #text button{ margin: 20px 0px 10px; } #port1{ width:500px; height:200px; background-color:green; font-weight:bold; font-size:1.2em; padding:25px; position:absolute; left:-100% } #port2{ width:500px; height:200px; background-color:yellow; font-weight:bold; font-size:1.2em; padding:25px; position:absolute; right:-100%; }

you can see in action here: http://jsfiddle.net/belotte/vmu59h87/19/

thanks

please check jsfiddle

the fiddle given ekansh getting failed when right btn clicked sec time (reason right, left css clash guess).

$('#left').on('click',function(){ console.log( $('#port1').css('left')); $('#port2').removeattr('style'); $('#port1').animate({left:'8'}); }); $('#right').on('click',function(){ console.log( $('#port2').css('right')+'right'); $('#port2').removeattr('style'); $('#port2').animate({right:'-39px'}); }); $('#leftc').on('click',function(){ $('#port1').animate({left:'-532px'}); }); $('#rightc').on('click',function(){ $('#port2').animate({right:'-529px'}); });

javascript jquery html jquery-animate

c# - Paging In MVC Table Grid -



c# - Paging In MVC Table Grid -

what trying accomplish include paging functionality in grid(generated html table , foreach).

i not allowed utilize entity framework, webgrid, or other 3rd party grid.

below details of task:

demotestdata.cs file

namespace demo.data { public class demotestdata { demotestmodel objdemotestmodel = null; public string connectionstring { get; set; } public sqlconnection objconnection { get; set; } public sqlcommand objcommand { get; set; } public sqldatareader objreader { get; set; } public list<demotestmodel> getalldemotest() { list<demotestmodel> listdemotest = new list<demotestmodel>(); seek { objconnection = new sqlconnection(configurationmanager.connectionstrings["conn"].connectionstring); objconnection.open(); objcommand = new sqlcommand("sp_demotest", objconnection); objcommand.commandtype = system.data.commandtype.storedprocedure; objreader = objcommand.executereader(); if (objreader.hasrows) { while (objreader.read()) { // list populated here. objdemotestmodel = new demotestmodel(); objdemotestmodel.id = convert.toint32(objreader["id"].tostring()); objdemotestmodel.column1 = objreader["column1"].tostring(); objdemotestmodel.column2 = objreader["column2"].tostring(); objdemotestmodel.column3 = objreader["column3"].tostring(); objdemotestmodel.column4 = objreader["column4"].tostring(); objdemotestmodel.column5 = objreader["column5"].tostring(); objdemotestmodel.column6 = objreader["column6"].tostring(); listdemotest.add(objdemotestmodel); } //return liststatemodel; } } grab (exception ex) { string m = ex.message; } { if (objconnection != null) { objconnection.close(); } } homecoming listdemotest; } } }

sp_demotest procedure

create procedure [dbo].[sp_demotest] begin select id,column1,column2,column3,column4,column5,column6 dbo.demotest end

demotestmodel.cs file

namespace demo.entities { public class demotestmodel { public int id { get; set; } public string column1 { get; set; } public string column2 { get; set; } public string column3 { get; set; } public string column4 { get; set; } public string column5 { get; set; } public string column6 { get; set; } } }

demotestcontroller.cs file

namespace sampleproject.controllers { public class demotestcontroller : controller { // // get: /demotest/ //test tst = new test(); demotestdata info = new demotestdata(); //list<countrymodel> listmodel = new list<countrymodel>(); list<demotestmodel> listmodel = new list<demotestmodel>(); //demotestmodel demotestmodel = new demotestmodel(); public actionresult index() { listmodel = data.getalldemotest(); homecoming view(listmodel); } } }

index.cshtml file

@model ienumerable<demo.entities.demotestmodel> @{ viewbag.title = "index"; } <h2>index</h2> <table> <tr> <th> @html.displaynamefor(model => model.column1) </th> <th> @html.displaynamefor(model => model.column2) </th> <th> @html.displaynamefor(model => model.column3) </th> <th> @html.displaynamefor(model => model.column4) </th> <th> @html.displaynamefor(model => model.column5) </th> <th> @html.displaynamefor(model => model.column6) </th> <th></th> </tr> @foreach (var item in model) { <tr> <td> @{ if (item.column1 == "textbox") { @html.textboxfor(modelitem => item.column1) } else if (item.column1 == "dropdown") { @html.dropdownlistfor(modelitem => item.column1, enumerable.empty<selectlistitem>()) } else { @html.displayfor(modelitem => item.column1) } } </td> <td> @{ if (item.column2 == "textbox") { @html.textboxfor(modelitem => item.column2) } else if (item.column2 == "dropdown") { @html.dropdownlistfor(modelitem => item.column2, enumerable.empty<selectlistitem>()) } else { @html.displayfor(modelitem => item.column2) } } <td> @{ if (item.column3 == "textbox") { @html.textboxfor(modelitem => item.column3) } else if (item.column3 == "dropdown") { @html.dropdownlistfor(modelitem => item.column3, enumerable.empty<selectlistitem>()) } else { @html.displayfor(modelitem => item.column3) } } </td> <td> @{ if (item.column4 == "textbox") { @*@html.textboxfor(modelitem => item.column4)*@ @html.textbox("test", "", new { style = "width:130px;" }) } else if (item.column4 == "dropdown") { @html.dropdownlistfor(modelitem => item.column4, enumerable.empty<selectlistitem>()) } else { @html.displayfor(modelitem => item.column4) } } </td> <td> @{ if (item.column5 == "textbox") { @*@html.textboxfor(modelitem => item.column5)*@ @html.textbox("test1", "", new { style = "width:130px;" }) } else if (item.column5 == "dropdown") { @*@html.dropdownlistfor(modelitem => item.column5, enumerable.empty<selectlistitem>())*@ @html.dropdownlistfor(modelitem => item.column5, enumerable.empty<selectlistitem>(), new { style = "width: 130px" }) } else { @html.displayfor(modelitem => item.column5) } } </td> <td> @{ if (item.column6 == "textbox") { @html.textboxfor(modelitem => item.column6) } else if (item.column6 == "dropdown") { @html.dropdownlistfor(modelitem => item.column6, enumerable.empty<selectlistitem>()) } else { @html.displayfor(modelitem => item.column6) } } </td> </tr> } </table>

(if..else status used generate dynamic controls)

this rendered view

it nice if provide solution.

c# .net asp.net-mvc

SQL count function not working -



SQL count function not working -

i want count number of instances tuition not equal 99999.99, having hard time getting sql count function work. have next query:

select year, college, case when tuition < 99999.99 'other' else to_char(tuition) end tuition, count(*) tuition_count enrolment grouping year, college, tuition order year, college, tuition

i expecting next results, count "other" rolled up.

year college tuition tuition_count --------------------------------------------- 2012 collegea other 123 2012 collegea 99999.99 456

instead, getting multiple instances of "other", 1 each distinct value of tuition.

year college tuition tuition_count --------------------------------------------- 2012 collegea other 100 2012 collegea other 20 2012 collegea other 3 2012 collegea 99999.99 456

you need grouping (in grouping statement) want. this:

select year, college, case when tuition < 99999.99 'other' else to_char(tuition) end tuition, count(*) tuition_count enrolment grouping year, college, case when tuition < 99999.99 'other' else to_char(tuition) end order year, college, case when tuition < 99999.99 'other' else to_char(tuition) end

this looks nicer:

select year, college, tuition, count(*) tuition_count ( select year, college, case when tuition < 99999.99 'other' else to_char(tuition) end tuition enrolment ) subselect grouping year, college, tuition order year, college, tuition

sql count

android - Application installed in system/priv-app not starting without reboot (root) -



android - Application installed in system/priv-app not starting without reboot (root) -

i working on rooted device. have created application run scheme app. have copied apk file sd card , /system/priv-app after mounting /system directory adb shell su user. manifest file looks follows

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="abc.def.settings" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="19" /> <uses-permission android:name="android.permission.receive_boot_completed" /> <uses-permission android:name="android.permission.write_settings" /> <uses-permission android:name="android.permission.write_apn_settings" /> <uses-permission android:name="android.permission.modify_phone_state" /> <uses-permission android:name="android.permission.read_phone_state" /> <uses-permission android:name="android.permission.call_phone" /> <uses-permission android:name="android.permission.read_call_log" /> <uses-permission android:name="android.permission.write_call_log" /> <uses-permission android:name="android.permission.write_secure_settings" /> <uses-permission android:name="android.permission.change_network_state" /> <uses-permission android:name="android.permission.status_bar" /> <uses-permission android:name="android.permission.expand_status_bar" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <service android:name="abc.def.settings.service.systemsettingsservice" > </service> <receiver android:name="abc.def.settings.boot.devicebootreceiver" > <intent-filter> <action android:name="android.intent.action.boot_completed"/> <action android:name="abc.def.settings.start_after_reinstall"/> </intent-filter> </receiver> </application> </manifest>

once copied apk /system/priv-app changed permission 777 shell. application starting on device boot much fine. unable start service before rebooting. 1 of limitations device should not rebooted start service.

i tried next none of them worked.

adb shell startservice -n abc.def.settings/.systemsettingsservice adb shell startservice -n abc.def.settings/.service.systemsettingsservice adb shell startservice -a abc.def.settings.start_after_reinstall adb shell broadcast -a abc.def.settings.start_after_reinstall adb shell broadcast -a abc.def.settings.start_after_reinstall -f 32

is there missing.!! in advance.

android android-intent android-service rooted-device

android - ListFragment's setListShown method not working -



android - ListFragment's setListShown method not working -

i'm using listfragment parsequeryadapter in order show list of leagues (custom model). managed desired state except loading animation not showing @ all.

it seems animation hidden when listsadapter set (by setlistadapter method), set adapter after list fetched, parsequeryadapter fetches list after setting adapter list.

so found can utilize setlistshown method in order hide/show animation, in current implementation doesn't work.

my code:

public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); sethasoptionsmenu(true); // create query mill parsequeryadapter.queryfactory<league> mill = new parsequeryadapter.queryfactory<league>() { public parsequery<league> create() { parsequery<league> query = league.getquery(); query.whereequalto(league.field_user, parseuser.getcurrentuser()); query.orderbydescending(league.field_created_at); homecoming query; } }; // create adapter leaguelistadapter = new leagueadapter(getactivity(), factory); // loading listener leaguelistadapter.addonqueryloadlistener(new parsequeryadapter.onqueryloadlistener<league>() { @override public void onloading() { // show listfragment's loading animation while loading setlistshown(false); } @override public void onloaded(list<league> leagues, exception e) { if(e == null){ // hide loading animation , show list setlistshown(true); // set leagues in cache leaguescache.getinstance().setcachedleagues(leagues); } else { toast.maketext(getactivity(), e.getmessage(), toast.length_long).show(); } } }); // set fragment's adapter setlistadapter(leaguelistadapter); // dialogs addleaguedialog = new addleaguedialog(this); }

android parse.com android-listfragment android-parsequeryadapter

string - Rewrite rule help should be simple but not for a newbie like me -



string - Rewrite rule help should be simple but not for a newbie like me -

my oroginal url looks this

http://www.example.com/showads.php?type=1

and rewrite seems work

rewriterule ^listings/type/([0-9]+)/?$ showads.php?adtype=$1 [nc,l]

so have type www.example.com/listings/type/1 , goes original url

my problems comes when add together 1 more parameter original url this

http://www.example.com/showads.php?type=1&clearfilters

i have tried several combinations of rewrites none of them work.

the lastly 1 have before giving this

rewriterule ^listings/type/([0-9]+)/clear?$ showads.php?type=$1&clearfilters [nc,l]

what doing wrong? in lastly rewrite? help appreciated.

thanks

jt

better explanation

thanks reply. however,that still not work.

let me seek explain happens

if type url

http://www.example.com/showads.php?adtype=3&clearfilters

i expected results. , here explanation of it's use

a user clicks on various links on site , each link sets different session variable. on span of few clicks there 5 or 6 session variables set.

if 1 submit url without clearfilters

http://www.example.com/showads.php?adtype=3

you setting session variable adtype 3

so have adtype session variable , perchance few other set

when submit url clearfilters set

http://www.example.com/showads.php?adtype=3&clearfilters

the page unsets existing session variables , sets adtype session 3.

having said that, looking rule clean url , type like:

http://www.example.com/listings/type/3/clear

to same ugly url.

maybe there improve way. ears.

thanks

jt

it not clear question if want same replacement url regardless of whether have or not have /clear part of url.

if want same replacement url or without /clear, can utilize this:

rewriteengine on rewriterule ^listings/type/([0-9]+)(/clear)?$ showads.php?type=$1&clearfilters [nc,l]

if want clearfilters parameter in replacement url when typed url has /clear part, can this:

rewriteengine on rewriterule ^listings/type/([0-9]+)$ showads.php?type=$1 [nc,l] rewriterule ^listings/type/([0-9]+)/clear$ showads.php?type=$1&clearfilters [nc,l]

string apache rewrite rules