Monday, 15 September 2014

BigQuery, TableRow: access repeated records with java api -


I'm accessing BigQuery data through the Java API and new service dataflow. I expected that the tablewares had such methods that:

  • Return the list of tableclass examples (in the case of repeated fields)
  • Return a tablewise frequency (in case
  • Return the list of tablewise examples (in the case of repeated nested fields)

But I've just got a sample code to get the method. Reach the fields which are not convenient The output is an example of a class object.

The only solution I have seen for this moment is by parsing the pars that I get by method and create a tableaway object on its own. But I was wondering if anyone could have a better solution to share?

Many thanks.

In the end, I came to these conclusions:

  • If you according to your schema If you are expecting an area to be defeated, then your method will return an ArrayList instance, which will be applied to your tabler instance.
  • If you are expecting a record according to your schema, your TableRow will return an example of LinkedHashMap for example.
  • If you have guessed according to your schema that you expect a replicated field of records, then there is a method that applies to your tableware instance.

So you must subtract the result from the method applied to your tablev example with any one of the above sections, and then you will use the IR attributes (iterate and name for example Is calling from).


xcode - Facebook SDK on Unity 5 on iOS -


I have trouble getting the latest Facebook SDK 6.2.1 to work with my project and Integration 5.0.0f4 Is happening Down one

Here's what I do: -

  1. Create a blank project
  2. Import the Facebook SDK
  3. Set up the app < / Li>
  4. Create a Xcode project
  5. Open in Xcode
  6. Disable ARC in Settings
  7. Remove Extra #ndiffs , When Xcode complains about it
  8. To create and run a game on iOS device

The following link I end the error: -

dl.dropboxusercontent.com/u/13490919/FacebookiOS Problem / Screenshot% 202015-03-12% 2014.53.29.png

I found the error "EXC_BAD_ACCESS (code = 1)". I'm not too much of an Xcode / iOS so it confuses me to one voice load. If Facebook does not exist then this error does not occur. Has anybody got any idea about this? Of course I am not the only one with this issue, what I want to do is get an access token from Facebook. If needed, I will not be taken care of using a simple webview or something similar.

Any help on this will be highly appreciated. I'll give it to the free hugs but know.

Thanks

Ive solved the problem as someone else posted , You need to mark "iOS" as the option for the plugin and adding "-fno-objc-arc" to the composite flag in the following file: Property / Facebook / Editor / IOS / FbUnityInterface .mm

This works with the latest versions of Unity 5.0.1f and Facebook SDK 6.2.1 as this post.


python - UndefinedVariableError when querying pandas DataFrame -


I am trying to create a graph by querying values ​​in Pando DataFrame .

In this line:

  data 1 = [np.query ('type == i') ['continuous'] i ('type' 1 ',' Type 2 ',' Type 3 ',' Type 4 ']]  

I get an error:

  Unchanged Variable error: Name 'I' is not defined  

What am I missing?

i in your query expression

  df.query ('type == i')  

Really just string 'i' is there is no extra insert quote , So Panda interprets it as the name of any other column in your DataFrame , that is, it looks for those cases where

  df ['type'] Since there is no  i  column, you get an  unchanged variable error .  

P>

It looks like the value in the type column is equal to the string variable name i , that is where

  Df ['type'] == 'Type1' df ['type'] == 'Type2' # etc  

In this case, you really need to put string i in the query expression:

df.query ('type == "% S" '% i)

Extra set of quotes are required if ' Type1 ', ' type2 ' etc. Value within the type column, but if they are not the names of other columns, the dataframe.


java - MongoDB - Difference between getCollection(String name) and getCollectionFromString(String collectionName)? -


Does anyone expose the difference between getCollection (string name) and getCollectionFromString (string archive name) in the form of documents in Mokodi DB Can Java API?

  The public DBCollection getCollectionFromString (string archive name) returns a collection that matches a given string. Parameters: Collection Name - Archive Name Returns: Collection  

and

  Public DBC selection getCollection (name of string) gets archived with a given name is. Parameter: Name - Archive Name Return for Return: Collection  

Example with an example would be most useful (pulled from)

In response to Carl Seguin:

The collection can be identified by a namespace, "db.collection". GetCollectionFromString gets archive for that type of namespace GetCollection it only gets to the raw archive.

In those places where you require / getCollectionFromString to use some kind of mongodb management tool or possibly a CMS to do with that many databases ... dynamic-driven system It may be that the getCollection for most apps is more specific.

another :

I think what you use will really depend on your users There is hope to enter.

If they do not know anything about all the databases, then using getCollection () makes sense ... which I think is the case.

If this is a truly dynamic system and the user can say "Get me from database app 1" then getCollectionFromStirng could mean.

However, I argue that int another matter, it would be better in just two areas: database and archive. To combat this way it is more clear and simple. Your users should know how the database and archive have been separated in Doong mongodibi? For example getCollection (strings) :

  package com.example.core  

; Import java.net.UnknownHostException; Import java.util.Set; Import com.mongodb.db; Import com.mongodb.DBCollection; Import com.mongodb.mongo; Import com.mongodb.MongoException; / ** * Java: MongoDB * * Get access to the public category GetCollectionApp {Public Fixed Zero Main (string [] Args) {try {Mongo mongo = new Mongo ("localhost", 27017); DB DB = Mongo .get DB ("yourdb"); // Get a list of archives & lt; String & gt; Collection = db.getCollectionNames (); (String archive name: archive) {System.out.println (collectionName); } // Get a collection of DBCollection collection = db.getCollection ("yourCollection"); Println (collection.toString ()); Println ("full"); } Hold (unknownhostexception e) {e.printStackTrace (); } Hold (MongoExation E) {e.printStackTrace (); Public DBCollection getCollectionFromString (string s)) {DBCollection foo = null;

While (s.contains (".")) {Int idx = s.indexOf ("."); String b = s.sbrstring (0, idx); S = s.sstring (idx + 1); Foo = getCollection (B); } If (foo! = Null) return foo; Retrieve compilation; }

html - How to fix form, input default overflow behaviour -


जब मैं इनपुट प्रकार text को में डालता हूं > फ़ॉर्म इनपुट अतिप्रवाह फ़ॉर्म द्वारा 4 पिक्सेल ; यह केवल तभी प्रकट होता है जब चौड़ाई है 100%

आईडी :

 < कोड> & lt; html & gt; & Lt; शीर्ष & gt; & Lt; title & gt; & lt; / title & gt; & LT; शैली & gt; इनपुट {चौड़ाई: 100%} & lt; / style & gt; & Lt; / head & gt; & LT; बॉडी & gt; & Lt; form & gt; & lt; इनपुट प्रकार = "टेक्स्ट" / & gt; & lt; / form & gt; & Lt; / body & gt; & Lt; / html & gt;  

ऐसा क्यों होता है?

< P> क्योंकि अधिकांश ब्राउज़र्स & lt; इनपुट प्रकार = "टेक्स्ट" & gt; तत्वों के पास एक 2px सीमा बनाते हैं 2px left + 2px right = 4px चूंकि चौड़ाई सीमा की गिनती नहीं करती, चूंकि चौड़ाई = कंटेनर चौड़ाई का 100%, सीमा का 4px कंटेनर से अधिक हो जाता है।

यह सही करने का एक संभव तरीका है बॉक्स-साइजिंग लागू करना है: बॉर्डर बॉक्स तत्व के लिए ब्राउज़र को बॉक्स के आकार की अलग तरह से गणना करने के लिए (पैडिंग और सीमा सहित)।


Details of the equivalent of joins in Mongodb -


I understand that does not support "Johns" as a relational database, but I'm sure Did not mean that it would really mean what's specific

Does this mean that you can not ask mongodb to do your standards:

  SELECT P.name, j.title FROM person P, job j where p.p_id = J.j_id  

Or does this simply not apply the relevance of reciprocity for you?

I was also hoping to understand how to link it ("joining"?) Related to the collection. I understand that the _id reference for compilation should be used like FK, although I'm not sure whether it will depend on the application to provide compatible code for inclusion, or if MangondoB uses its native language Now, you can join the external external on the Unshared collection in the Mongond 3.2 in the

doing.

  {$ lookup: {from: & lt; To join the collection & gt; localField: & lt; Field from Input Documents & gt; Foreign Field: & lt; From "archive", such as: & lt; Output array field & gt; }}  

See for more information.

However, even if mongodb joins support, this is a non-relational database and therefore you have your application in this way. You should prefer to embed such documents.


c# - How to programatically delete Azure Active Directory user? -


I am using the following code executes the code fine but does not remove the user.

  IUser deleteuser = new user (); Deleteuser = users.Where (myuser = & gt; MyUase r.MailNickname.Equals ("IshanArora") FirstOrDefault (); If (Delilizer = Null) {deleteuser.DeleteAsync (); }   

I delete the users before retrieving it:

  Delete Private Async Tasks Device () {ActiveDirectoryClient Client = Authentication Helper.GetActiveDirectoryClient (); // Recover user from your display name var user = wait for customer. the user. Where (u = & gt; u.DisplayName == "user two"). ExecuteSingleAsync (); // or retrieve the user with your original name / var user = wait client.Users.Where (u = & gt; u.UserPrincipalName == "user two") ExecuteSingleAsync (); // URL from the URL in the directory from the URL / var user = waiting client.Users.GetByObjectId ("0b34c995-0970-4776-ae87-f66d384f9c45"). ExecuteAsync (); // Cancel the user from the user. DeleteAsync (); }  

You should see that the user has been removed from the Ezoor Portal


Method for logging user access -


Target: Keep a table of user login and type a record when exiting

The API After trying to use the code, it could not access the Windows ID function with the idea of ​​writing it. Allow access to thought and authentication when using a username and password to read from a table and get certified.

I used this code to log each code And close to the windows in the application. I'm going to logout the user through the login screen to track usage. Works fine for my purposes.


android - Receiving boot complete without UI -


My app has no UI I need to get boot_complete broadcast to complete some setup actions I see Android has an app prevented from receiving the broadcast, unless it is launched by the user. I was thinking that this is a way to do the job.


Check if PHP session has already started -


I have a PHP file, sometimes called a page that starts a session, Ever since the session started, so when I have the session_start () on this script, I sometimes get the "Session preceding" error message, The lines are inserted:

  if (! Isset ($ _COOKIE ["PHPSESSID"])) {session_start (); }  

But this time I got this warning message:

Notice: Undefined variable: _SESSION

is what This is a better way to check whether the session has already started.

If I use @ session_start , will it work properly and just stop the warnings? Recommended method for

Strong> PHP> = 5.4.0

  

Source:

PHP & lt; 5.4.0

  if (session_id () == '') {session_start (); }  

javascript - Send $http request before initialize routing? -


मेरे पास $ rootScope है। $ ("$ StateChangeStart") घटना जो शीर्षक , और विवरण और मुझे $ rootScope ऑब्जेक्ट का उपयोग करने के बाद करना होगा $ http अनुरोध, मेरे ईवेंट में। समस्या यह है कि जब $ stateChangeStart ईवेंट चलता है, मेरा वस्तु अपरिभाषित है।

मैंने अपने ui-router राज्यों पर हल का उपयोग करने की कोशिश की है। लेकिन यह केवल नियंत्रक के लिए काम करता है, event नहीं।

क्या आप मुझे एक समाधान के साथ आने में मदद कर सकते हैं, जो मेरी सेवा ( रूटिंग आरंभ (और $ stateChangeStart ईवेंट चलाता है) से पहले $ http अनुरोध), और यह राज्य परिवर्तन के बाद फिर से इस सेवा को नहीं चलाएगा।

मैंने इसे वादा के साथ हल करने का प्रयास करने का निर्णय लिया:

  $ ("$ StateChangeStart", फ़ंक्शन (ईवेंट, toState, toParam, fromState, fromParams) {if ($ rootScope.myObj) {// अगर मेरी "ऑब्जेक्ट" पहले से ही इवेंट लॉजिक ();} और (getMyObj) Init ()। तब (फ़ंक्शन (रेस) {// कॉल सेवा जो एक वादा किया गया इवेंट लॉन्जिक ();})}} समारोह eventLogic () {...}}  

यह समाधान मेरी समस्या पूरी तरह से हल करती है। यह $ rootScope.myObj के लिए इंतजार करता है और यह केवल एक बार इस सेवा को चलाता है।

< / Html>

php - inserting ads after every 7th post in wordpress home page -


I am trying to place Google ads among every 7 posts in the category pages of my homepage and WordPress site.

I found this code on the WordPress forum and tried it myself by putting it, it did not work. I'm not sure how to use this code in my theme. The code I got is this.

  if (has_posts ()): $ count = 0; While (is_pause ()): the_post (); // First if (($ count> 1) & amp; amp; ($ count% 5 == 0)) {? & Gt; & Lt; Div & gt; [Adcod] & lt; / Div & gt; By & lt;? } $ Count ++;  

My topic is relative code from index.php.

  if (has_posts ()): while (has_posts ()): the_post (); ? & Gt; & Lt ;? Php if (floatwal (get_bloginfo) & lt; "3.6") // Original post formats get_template_part ('/ post-templates-pre-3-6 / entry', Get_post_format ()); } Else {// WP 3.6+ post formats get_template_part ('include / post templates / entry', get_post_format ()); }? & Gt; & Lt ;? Php timeline; end if; ? & Gt;  

I want to know how do I enter code according to the upper code of index.php? Thanks to

You can create a $ counter on it Based on the ad code, the final code will be for you:

  $ counter = 1; If (is_pause ()): while (is_pause ()): the_post (); ? & Gt; & Lt ;? Php if ($ counter% 7 == 0) {? & Gt; [Adcode] & lt ;? Php} if floatwal (get_bloginfo ('version')) in (get_template_part) ('/ include post-template-pre-3) & lt; "3.6") -6 / entry ', get_post_format ()); } Else {// WP 3.6+ post formats get_template_part ('include / post templates / entry', get_post_format ()); }? & Gt; & Lt ;? Php $ counter ++; Endwhile; end if; ? & Gt;  

We only raise $ counter, and display [adcode] after every seven posts.


php - Parameter with quotes within a query not working -


तो मेरे पास यह कोड है:

  $ infos ['title'] = addlashes ( "ले रॉय डी 'ऑस्ट्रेलिया"); $ ऑफ़र = get_page_by_title ($ infos ['title'], ARRAY_A, 'post');  

यह काम नहीं करता है जबकि मेरे पास अन्य उद्धरण के साथ अन्य पद वास्तव में अच्छा काम कर रहे हैं।

क्या आपके पास एक जवाब है?

आपको पहले से धन्यवाद।

java - Reload class using custom class loader -


I am planning to use hot class of class using custom class loader. For this purpose I have written a custom class loader which looks i

  public class custom class loader classload loader {public custom class loader (class load loader parent) {super (parent); } Public class load class (string name) throws classicsonfoundation (if !! !!) "Classloader. Testcase". Axles (name) return super. Load class (name); Try {string url = null; String clzName = null; Url = "file: /home/naveen/workspace/JavaConcept/bin/classLoader/TestCase.class"; ClzName = "classLoader.TestCase"; } Url myUrl = new URL (url); URL Connection Connection = myUrl.openConnection (); InputStream input = connection.getInputStream (); BytereanOutOperputStream buffer = new byteOnputstream (); Int data = input Reed (); While (data! = -1) {buffer.write (data); Data = input Reed (); } Input.close (); Byte [] ClassData = Buffer. To Batteryre (); Return defineClass (clzName, classData, 0, classData.length); } Catch (malmarmdureleuxation E) {e.printStackTrace (); } Hold (IOException e) {e.printStackTrace (); } Return tap; }}  

Now I have another class called Tests, in which there is a method called print ().

  Public Zero Print () {System.out. Println ("hello"); Println ("bye"); }  

And I'm calling it this way with the main method

  throws public static zero main (string AGR []) InstantiationException, IllegalAccessException {TestCase t = New TestCase (); T.print (); {Class Loader Class Loader = Custom Class Loader. Try Clash Gate Classloader (); Classloader = new custom class loader (classloader); Class Clause = Classloader Load class ("Classloader. Test season"); TestCase T2 = New Testing (); T2.print (); } Grip (Klassnotfound Expression E) {e.printStackTrace (); }}  

Now here I want to do one thing which is said inside a main t.print () method which prints hello and goodbye on the console. Now I have another version of this test case class print method which only prints Hello, so what did I do? I told the program in debug mode and programmatically classloader Load class (not allowed to run till line). So I changed testcase.class to the directory structure with the new version, which only prints Hello. But still this production is Hello and showing goodbye. Is anyone wrong in this program or can help me understand the class loader? Please correct me and help complete your work.

Custom Class Loader Because many rules require you to keep in mind, in your case, I think that The problem is that your class file is part of your program, which means that if you try to load a class, then the default class loader will load before calling your load class () method that will ever call will not be done. Try removing your class files from your classpace so that there is no part of your program, then your load class () should be called.

The other problem is that you are creating new by using your testsecuse object, which will call the default class loader, a better way classloader.loadclass () and then make an example by returning the class , But if you put it on tests, it means that the class is defined in your default classloader which leads to the first problem. Alternatively, you have to create an interface and put that method so that your method can be called.


c# - The type or namespace name does not exists? (static class) -


I have just started to make my website (from the beginning of the empty project) and I am getting some errors, I'm really confused! error default.aspx

  & lt; % @ Page language = "C #" codefile = "default.aspx.cs" Inherits = "MonoLiteTech website.default"%> & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" /> & Lt; Title & gt; Monolit Technology & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt;% = Monolite Tech Website. Style. Testfield% & gt; & Lt; / Body & gt; & Lt; / Html & gt;  Style CST  Style.cs  (Build: Collect)  
  Namespace Monolite Tech. Website {public stable class style {public static string testfield = "monoilite technology"; }}  

Resolution hierarchy

solution hierarchy

Visual Studio: I also noticed that VS Style class and test-field members can view

enter image details here

I'm already a C # programmer (desktop) and I 'm sure, there is no problem with subscriber access I resume of the project, Clear solution and rebild project also what is wrong? I think it should be simple :)

Edit:

In the end I know what is wrong i output path to . << Code> to bin \ has changed back and it works. I really do not know why, but this is a solution for me, maybe someone can explain it to us later (I hope). And I think, starting from scratch is not always the best way :)


objective c - iOS Swift: Calling a singleton method 3 times causes app to crash -


I have the purpose / swift side code. I'm calling a swift singleton method 3 times after crashing three times. I have reason to believe that this may be a memory problem here my code is

ViewController.m

  - Called (zero) shared data {// Got three times the shared data = [SharedData sharedData]; [SharedData initSyncManager]; }  

Swift shared data class

  class func sharedData () - & gt; SharedData {struct singleton {static example instance = shared data ()} Return Singleton.instance} func initSyncManager () {}  

Error on this line is EXC_BAD_ACCESS (code = EXC_i386_GPFLT)

  'Single Singleton Return Return'  

I do not know why is happening. I do not have any code in initSyncManager and this crash occurs only when I use this code

  [sharedData initSyncManager];  

If I do not call the method 3 times, then there is no accident.

You can try it, because I'm using it to create singleton classes (SWIFT 2.1) and this is working well for me:

  class var sharedInstance: SharedData {Static Static {Static Verteach Talk: dispatch_once_t = 0 static var Example: ShareData? = Ventricle} dispatch_postima (& amp; static.onsontocon) {Static.instance = SharedData ()} Return Static.instance! } Override init () {super.init () // initialisation}  

java - Android: Tabs inside fragment findViewById returns null? -


I have an activity in which there is a piece. There is a button inside that piece, which should be clicked when the piece of pieces (pieces, too) will be replaced by a piece inside.

However, when the tab piece is full and I try to find my viewer by ID, FindViewById () returns empty.

Here is my code: inside the piece with the button:

  @Override Public Zero (click view) {switch (view.getId ()) { Case R.id.gewichtActualiserenButton: // TODO Apply Tab // GewichtTabsFragment MainActivity replace the current section with mainActivity = (main activity) getActivity (); GewichtTabsFragment gewichtTabsFragment = New GewichtTabsFragment (); Main activity. Substantiation (gewichtTabsFragment, Constants.GEWICHT_TABS_FRAGMENT); break; Case R.id.geburtsdatumEditText: showDatePickerDialog (see); break; Case R.id.hundImageView: // Display the warning to choose from the camera or gallery ImageSourceChooserDialog newFragment = New ImageSourceChooserDialog (); NewFragment.setHundFragment (this); NewFragment.setWithDeleteItem (true); ImgChooserDialog = newFragment; Newfragment.show (getActivity (). GetSupportFragmentManager (), "image_source_chooser"); break; Case R.id.zusaetzeSwitch: // toggle active status zusaetze edit text GetZusaetzeEditText (). SetEnabled (! GetZusaetzeEditText (). IsEnabled ()); Default: Break; }  

GewichtTabsFragment.java:

  @ Override public view creatives (LayoutEfterter Inflator, View Group Container, Bundle Saved InstantState) {// For this Increase the layout view section see = inflater.inflate (R. fragment_gigThat_tab, container, incorrect); Main activity main activity = (main activity) getActivity (); // Get ViewPager and set it to a pager adapter so that it can display items / / tap the following call returns? Why? ViewPager viewPager = (ViewPager) view.findViewById (R.id.viewpager); ViewPager.setAdapter (new GewichtFragmentPagerAdapter (mainActivity.getSupportFragmentManager ())); // Pager SlidingTabriptition ViewPager Pagerlide Tabstrip Tab Strip = (Pagerlide Tabstrip) getActivity () FindViewById (R.id.tabs); // View Tab Bar Tabs Attach PageRank Strip.setViewPager (viewPager); Return view; }  

and the layout file fragment_gewicht_tabs.xml:

   "True" Android: layout_width = "match_perrent" android: layout_height = "48dp" & gt; & Lt; /com.astuetz.PagerSlidingTabStrip> Android: Android: Android: Android: Android: Android: Android: Android: "Android: Color / White" /> ; & Lt; / LinearLayout & gt;  

Why is ViewById returns empty?

This will be zero because you are trying to get the view that has not been created yet. has gone. Change then

  ViewPager viewPager = (ViewPager) view.findViewById (R.id.viewpager);  

From

  View pager viewpages = (Viewpoint) getActivity (). FindViewById (RID Overview);  

linux - SublimeText build system for C/C++ in Terminal. -


I am using "Linux Centos-7" and here I am installing "SublimeText-3". The C-C ++ code is running fine in the Sublime Text Console but I want to run those code in the Linux terminal. I have included some queues like SublimeText build system -

  {"shell_cmd": "g ++ -std = c ++ 11 \" $ {file} \ "-o \" $ {File_path} / $ {file_base_name} .exe \ "", "file_regex": "^ (.. [^:] *): ([0- 9] +):? ([0- 9] +): "{{Name}:". (. *) $ "," Working_dir ":" $ {file_path} "," selector ":" source.c, source.c ++, source.cpp "," variant " Run "," Shell_cmd ":" g ++ \ "$ {file} \" -o \ "$ {file_path} / $ {file_base_name} \" "}}}  

above The code only has one executable file. Which I have to run manually in the terminal

and,

  {"cmd": ["g ++", "$ file", "-o", "$ {File_path} / $ {file_base_name}", "File_regex": "^ (.. [^:] *): ([0- 9] +):? ([0- 9] +)?:? (? *) $ "," Work_urd ":" $ {File_path} "," selector ":" source.c, source.c ++, source.cxx, source.cpp "," variants ": [{cmd "": "{{Name}:" run "," shell ": true" ":" "{" name "}": "g ++ \" $ {file} \ "- o" \ "$ {file_path} / $ {file_base_name} \", "variant" Is "CMD": ["gnome-terminal -e 'bash - c \" $ {file_path} / $ {file_base_name}; Echo; Echo; Press ENTER to continue the buzz; Read the line; Exit; This code can only run existing files in the terminal.  

Now, I just want to write code in SublimeText. "

Thanks

I It was in those days that after establishing grandeur some days ago I researched the situation for a while and ended up with "$ {File_path} / $ {file_base_name}"], "File_regex": "^ (.. [ ^:] *): ([0-9] +):? ([0- 9] +):? ("*; $)", "Working_direct": "{{" name ":" run "," cmd ": [" $ {file_path} "," selector ":" source.c, source.c ++, source .cxx, source.cpp "," variant "Bash", "-c", "g ++ -std = c ++ 0x '$ {file}' -o '$ {file_path} / $ {file_base_name}' and & Amp; Xterm-e bash -c '$ {file_path} / $ {File_base_name}; Read '']}]}

You may also need to install extras


C# ASP.NET MVC4 TextBoxFor-extension not replacing underscores with hyphens -


I have some type of overload for TextBoxFor-extension in my MVC4 application. The method looks like this:

  public static MvcHtmlString FormGroupTextBoxFor & LT; TModel, TProperty & gt; (MyHelper & lt; TModel & gt; myHelper, & lt; TModeel, TProperty & gt; & gt; expression, objection htmlAttributes = null of the function & lt; function)  

MyHelper Internally, there is an HtmlHelper-property used for "normal" MVC-accessories for which I do not have a surcharge.

In this method, I

  var route value decrease = new root values ​​(html property) {{"class", "form-control"}};  

Because I need to add some sections here

The next call is:

  var propertyInput = myHelper.HtmlInternal.TextBoxFor (Expression, Route Value Dict);  

which calls the default TextBoxFor () method.

When I call the extension

  @ My.FormGroupTextBoxFor (M => m.Name, new {@data_blur_update = "title", @data_blur_target_id = String.Format ("Vertical name {0}", eventID)})  

This rendered in HTML data_blur_update to Data-Blur-Update Why not change with?

What am I missing here?

I changed

  var Margololydict = new root value (html property ) {{"Class", "form-control"}};  

to

  var route value = HtmlHelper.AnonymousObjectToHtml property (html property); RouteValueDict.Add ("class", "form-control");  

Then insert the right attributes with hyphens instead of underscores which will


c# - The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced -


I'm trying to use a SQLite database with your Windows Store app I

Below is a data class, which starts when the app starts:

  Public Class DataLayer {SQLiteConnection m_dbConnection; Public DataLayer () {createDatabase (); } Create Public Zero Database () {SQLiteConnection.CreateFile ("QTabs.sqlite"); M_dbConnection = New SQLiteConnection ("Data Source = QTabs.sqlite; version = 3";); M_dbConnection.Open (); Stringbilder creatTables = new stringbilder (); // Create the SQL tables creatTables.Append ( "create table Sinktaim (Sinktaim_aidi primary key Otinintr, sync time DATETIME);); SQLiteCommand command = new SQLiteCommand (creatTables.ToString (), m_dbConnection); command.ExecuteNonQuery (); m_dbConnection .close ();}}  

What I am trying to do is build a database and fill it.

But I am getting this error :

Enter image details here

"Error 1 type 'System.Data common.DebConnect' is such a key Is defined in the assembly that is not referenced. You must add a reference to 'system.data, version = 2.0.0.0, culture = neutral, public keycon = B77A5C 561934E 90'. C: \ Users \ tunnelld \ Documents \ Visual Studio 2013 \ Projects \ QTabs 0.1 sqlite retry \ qtabs \ DataLayer.cs 14 25 QTabs "

I'm using the system. Data:

  using System.Data; using System.Data.SQLite;  

What's going on here? How do I fix it?

< P> Edit: I do not see any context to add.

Image details here Enter


javascript - Canvas drawing doesn't always render in Android webview -


I am trying to make a football game for mobile phones, which uses the mobile phone's goo system. There are 2 canvas: On one, I underline the field lines and on the other hand the actual ball movement. It works fine in desktop browsers (of course except for Gyo's part), but when I try to use it in the webview of Android, sometimes my field lines are not ready Sometimes the ball too Not being dragged, but I think solving a problem can help solve the other. Here's my markup:

  & lt; Div class = "wrap" & gt; & Lt; Canvas ID = "canvas field" height = "100%" width = "100%" & gt; & Lt; / Canvas & gt; & Lt; Div id = "icon" & gt; Image & lt; / Div & gt; & Lt; Div id = "name" & gt; Name & lt; / Div & gt; & Lt; Div id = "action-container" & gt; & Lt; Div id = "shake-container" & gt; & Lt; Img src = "picture / score_conconnected" id = "shake-icon" /> & Lt; / Div & gt; & Lt; Div id = "score-to-play" & gt; Score a goal & lt; / Div & gt; & Lt; / Div & gt; & Lt; Canvas id = "canvas play" height = "568" width = "320" & gt; Your browser does not support the HTML5 canvas tag. & Lt; / Canvas & gt; & Lt; / Div & gt;  

And this is JS:

  var canvasfield, CTX, WWW, WHEET, top-leftx, top life, topright x, top, bottom Latex, Lathey, right x below, right down, center, center, netimg, netx, neti, hit area, hit area, icon, apn, game, interval, info; / * Constants * / var margin hat = 60, margin side = 20, netwyth = 175, nethit = 48, linewidth = 6, centercrews = radius = 100, ballridges = 25, hit areawidth = netwyth-ball radius, hit area = linewidth, line Collar = "#ffffff"; Window.addEventListener ("Load", function () {setTimeout (init, 200)}); Function init () {wWidth = window.innerWidth; WHEIGHT = window.innerHeight; TopLeftX = DownLeftX = Marginside; TopLeftY = topRightY = margin hat; TopRightX = Asterisk = wWidth - marginside; Bottom Lift Y = Right Right Y = wHyight - Margin Side; CenterX = wWidth / 2; CenterY = (bottom Wi-Toplift Y) / 2 + margin hat; NetX = centerX - NetWeath / 2; Net Y = Margin Top - NetHeight; HitAreaX = centerX - Hit AreaWith / 2; HitAreaY = margin top-mariereheit / 2; Icon = document.getElementById ('icon'); Icon.style.top = centerY-icon offsetHeight / 2 + "px"; Icon.style.left = centerX-icon.offsetWidth / 2 + "px"; Icon.style.visibility = "visible"; AppName = document.getElementById ('name'); AppName.style.top = centerY + CenterCrackDarius + 16 + "PX"; AppName.style.visibility = "visible"; Info = document.getElementById ('info'); Canvasfield = document.getElementById ('canvasfield'); Ctx = canvasField.getContext ('2d'); Canvasfield.wind = wWidth; Canvasfield. Heights = wHight; DrawField (); // gameInterval = setInterval (frame, 40); } Function drawField () {//Info.innerHTML = "drawing"; Ctx.clearRect (0, 0, wWidth, wWidth); // field side lines ctx.linewind = linewhite; Ctx.lineCap = "square"; Ctx.beginPath (); Ctx.moveTo (topLeftX, topLeftY); Ctx.lineTo (topRightX, topRightY); Ctx.lineTo (RightX down, downright); Ctx.lineTo (below LftX, bottom L); Ctx.lineTo (topLeftX, topLeftY); Ctx.strokeStyle = lineColor; Ctx.stroke (); // Draw Left Central Line ctx.beginPath (); Ctx.moveTo (margin side, center y); Ctx.lineTo (centerX- CenterCrade, Center Y); Ctx.stroke (); // Draw Right Central Line ctx.beginPath (); Ctx.moveTo (centerX + CenterKRKRDS, Center Y) ctx.lineTo (wWidth-marginSide, centerY); Ctx.stroke (); // Draw Central Circle ctx.beginPath (); Ctx.arc (centX, centerY, centercurrentes, 0, Math.pi * 2); Ctx.fillStyle = "RGBA (180255,0.1.1)"; Ctx.fill (); Ctx.stroke (); // Draw Hit Area ctx.beginPath (); //ctx.fillStyle = '# F7CA18'; Ctx.fillRect (hit area, hit area, hit areawide, hit area); Ctx.closePath (); // Draw Net Netmog = New Image (); NetImg.onload = function () {ctx.drawImage (netImg, netX, netY); }; NetImg.src = 'images / net.png'; // draw bar ctx.lineWidth = lineWidth / 2; Ctx.beginPath (); Ctx.moveTo (NetX, margin hat); Ctx.lineTo (NetX, Neti); Ctx.lineTo (NetX + NetWidth, Neti); Ctx.lineTo (NetX + NetWidth, margin hat); Ctx.stroke (); }  

JSfield here:

What could be the reason for this and how can I fix it?


php - CodeIgnite change default database name on the fly -


I have codeigniter setup to connect 2 databases (default and site). I have to dynamically change the default database name and should use any new database using the default connection is there a way to do this?

The reason for this is that I want to set a cron script which runs commands on some databases, it is not possible to edit the application / config / database.php so it can be dynamically transformed. .

  $ active_group = 'default'; $ Active_record = TRUE; $ Phppos_client_name = substr ($ _ server) ['HTTP_HOST'], 0, stropo ($ _ server ['HTTP_HOST'], '.')); $ Db ['site'] ['hostname'] = 'php-pos-db'; $ Db ['site'] ['username'] = 'ffount'; $ Db ['site'] ['password'] = 'password'; $ Db ['site'] ['database'] = 'flbvan_site'; $ Db ['site'] ['debibrier'] = 'mysical'; $ Db ['site'] ['debreffics'] = ''; $ Db ['site'] ['pconnect'] = false; $ Db ['site'] ['db_debug'] = false; $ Db ['site'] ['cache_on'] = falls; $ Db ['site'] ['cachered'] = ''; $ Db ['site'] ['char_set'] = 'utf8'; $ Db ['site'] ['dccol' '] =' utf 8_garg_g '; $ Db ['site'] ['swap_pre'] = ''; $ Db ['site'] ['autoinit'] = true; $ Db ['site'] ['streikton'] = false; $ Db ['default'] ['hostname'] = "php-pos-db"; $ Db ['default'] ['username'] = "pff"; $ Db ['default'] ['password'] = "password"; $ Db ['default'] ['database'] = "phppoint_ $ phppos_client_name"; $ Db ['default'] ['dbdriver'] = "MySQL"; $ Db ['default'] ['dbipfix'] = "phpps_"; $ Db ['default'] ['pconnect'] = Wrong; $ Db ['default'] ['db_debug'] = Wrong; $ Db ['default'] ['cache_on'] = falls; $ Db ['default'] ['cachered'] = ''; $ Db ['default'] ['char_set'] = 'UTF8'; $ Db ['default'] ['DBCOL'] = 'UTF 8_Incode_C'; $ Db ['default'] ['swap_pre'] = '; $ Db ['default'] ['autoinit'] = true; $ Db ['default'] ['stricon'] = falls; / * File End Database .php * / / * Location: ./application/config/database.php * /  

The way you want me to think that it is not possible you can do it in an alternate way

1. Do not load the database on your autoload config.
2. Manually copy your database from $ this-> Load-> Using the database ('site'),

or $ this-> Load-> Database ('default')


html5 - Is <main><footer></footer></main> valid? -


सरल प्रश्न, बड़ा तर्क .. निम्नलिखित उदाहरण मान्य कोड है? ([अन्य कोड] पृष्ठ में अन्य वैध कोड का अर्थ है)

  & lt; main & gt; [अन्य कोड] & lt; footer & gt; & lt; / footer & gt; & lt; / main & gt;  

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


php - MSSQL character coding -


I am using ZF1 and MSSQL, I am using free TDS.

Today I'm making a backup ("For the test purposes the script" generated in studio management ", and I had to face a strange problem. In DB I see that ś, ć, ż etc. Like every letter is saved properly, but when I run a specific question in the ZF, I get some strange characters when I look in the DB.
This is really a troublesome problem, and I have had it last 4-5 hours Fixed Tried to do and still nothing.

I tried that:

  • ini_set ('mssql.charset', 'UTF-8');
  • set column in nvarchar, nchar
  • mb_convert_encoding ($ data, 'UTF-8')

JSON Decoded, but the characters are still wrongly decoded. (Without this method I get only "invalid UTF-8 ..." error)

Please enter the Freetds configuration file located in my server

  (/ usr / local / freetds / etc / freetds .config)  

Edit the file and set the client charset for the utft


jquery - Backloader uploader not working online -


I am using the backload jquery file upload to upload images. It's working fine in offline

After deployment on the server, the image is not uploaded and it also shows no error. Please help me with this problem.


angularjs - Can't resolve dependency for module function (restangular.IProvider) -


I am trying to set up the transgenor for the SPA project, but I as a dependency with the Kadahi-SNSG Unable to solve. I have installed it using the keyboard (and definitely defined TSD for definitions).

Hard work configuration

  tsng: {options: {extension: ".ng.ts"}, Dev: {files: [TODO: Based on the conference Automate the generation of configs {src: ["client / app / ** / *. Ts", "! ** / * .ng.ts"], Dest: "client / app"}]}},  

module apt

  /// & lt; Reference path = ".. /../typings/tsd.d.ts" /> Module app {var dependency = ["ui.router", "ui.bootstrap", "transjunal" ...]; Function Configuration ($ stateProvider: ng.ui.istateProvider, $ urlRouterProvider: ng.ui.IUrlRouterProvider, RestangularProvider: restangular.IProvider, & lt; - Here it fails ...  

Ts D.ts (Reference File)

  /// & lt; reference path = "restangular / restangular.d.ts" />  

  is running "tsng: dev" (tsng) function Warning: Error: Module function with name restangular.IProvider release dependency can not be resolved for App.config .  

Other dependencies, such as ui-router , ui-bootstrap < / Em> etc. are working fine.What can be the reason for this? GRANT-TNSG?

Okay, I have understood it.

> While executing Kadahi-SNSG, it scans all the dependencies / modules etc. so that they can be hooked to angles automatically so that you do not own it Apply: Apply: Dependency to identify your own (e.g. Where you have a TypeScript compliance code, such as classes in your module) can be defined by their name. Example:

  Constructor (Service: MyModule.IMyService) {}  

External dependencies, e.g. The angle itself is declared with '$' notation, content-ssg will assume that their dependencies are resolved on runtime and thus they are hooked in their name:

  Constructor ($ routeProvider: ng.IRouteService) {}  

But now the services in the transnors are not called '$ tranzinger', but only 'thrangular' it moves towards:

  • While declaring it 'invisible', grunt-tsng is your No one searches and fails in module, no one searches and fails
  • When declaring it as $$$, the angular provider will be called '$ tranjanagar', no one searches

Conclusion:

This is dim.


ubuntu 14.04 - java getRuntime().exec() does not work -


I am trying to use Java exec to run my exec and am getting the results I am using in the program.

I have lines of code I

  public static zero main (string [] argv throws exceptions {process p = runtime.gettime (). Exec ("phantomjs quebecPhantom.js"); BufferedReader = new BufferedReader (new InputStreamReader (p.getInputStream ()); String line = in.readLine (); System.out.println ("[x] transmitted '" + line + "' ');}  

I hope to execute my PhantomJS script And for the output of line variable script . But, my script does not execute (it should take more time and it should generate some screen shots which are not me ). And then, the line variable has zero value.

Do I have to disable my script Anything else should be considered for editing?

The problem with the above lines of code is that I want to execute the path of Phatcom and also execute the script in the command I want to execute, the line should be changed as follows,

  process p = runtime.gettimetime (). Exec ("path to phantomjs" + "" + "path on script");  

In my case it will be

  Rkriya p = Rntaimkgetritaim (). Exec ("/ usr / bin / phantomjs / home / name /quebecPhantom.js");  

c - .exe Stopped working loop issues? -


I am trying to write a method that opens 2 documents, and creates a contraction amount from the data written in the documents is. However, me Exe got the error stopped working, and this is a common thing I did not understand the way to solve the problem

Here is my code:

  zero conversions ( Four filename 1 [], four filename 2 []) {FILE * filepointer1; File * file line 2; Int counter = 0; Float xf; Setbuf (stdout, zero); Int oops = 0; Filepointer1 = fopen (filename 1, "r"); If (filepointer1! = NULL) {While fscanf (filepointer1, "% f", & amp; xf) == 1) {// 1 Finder for Counter ++; } Fclose (filepointer1); } Other {printf ("Error reading% s \ n", fileName1); } Int size1 = counter; // second data filepointer2 = fopen (filename 2, "r"); Counter = 0; If (filepointer2! = NULL) {while (fscanf (filepointer2, "% f", & amp; xf) == 1) {// 2 shape finder for counter ++; } Fclose (filepointer2); } Other {printf ("Error reading% s \ n", fileName2); } Int size2 = counter; Integer maximum size = size 1 + size 2-1; // array composition float holder 2 [max]; Int i = 0; For (i = size 2; i & lt; max -1; i ++) {// zero holder 2 [i] = 0.0 fill with; Float Holder 1 [Max]; Int x = 0; Fill with {// zero holder 1 [x] = 0.0 for x = size 1; x  

}


flex - RSL caching not working on Flash Player -


We have created a Flex application that is compiled in a SVF file which uses RSL linkage for various framework libraries. Which needs it. This is done to reduce the size of the SVF file. We are using the signed version URL of the library during the application form. The online documentation shows that signed SWZ files are cached by the Flash Player, so that they do not always be required to download. The SDF file is embedded in a PDF file. Our observation is that when we launch the Flex application by opening PDF file in Adobe Reader, then RSL is not being cached in the Flash Player. If we disable the network connection on the computer that opens the PDF file, the Flex application is not loaded. Is this the expected behavior? Or are we losing something? Although we open this Flex application in the browser, it works fine.

Is there any way in which we can keep RSL caching in the Flash Player, so that PDF can be opened in offline mode.

We welcome your suggestions on this


sql - How to search between dates ? mysql -


मेरे पास यह क्वेरी है:

  SELECT * FROM tabl1 WHERE (बनाया_टाइम के दौरान DATE_FORMAT (अब) (), '% Y-% m-02') और DATE_FORMAT (NOW (), '% Y-% m-02') + अंतराल 1 महीने और दिन (अब ()) 1) OR (created_time बिगड़ती DATE_FORMAT) (अब (), '% Y-% m-02') और DATE_FORMAT (अब,) '% Y-% m-02') - अंतराल 1 महीने और दिन (अब ()) = 1)  

यह प्रश्न पिछले महीने बनाए गए कॉलम लौटाएंगे, लेकिन महीने के दूसरे नंबर पर महीने की शुरूआत और अगले महीने के दूसरे दिन अंत में!

तो यह वापस आ जाएगी: < / P>

  3.3.2015 2.3.2015  

लेकिन यह वापस नहीं आएगा

  1.3.2015  

क्वेरी को बेहतर तरीके से कैसे लिखना है?

ऐसा हमेशा करें:

<पूर्व> wh पहले दिनांकफील्ड & gt; = आपका स्टार्टडेट और डेटफील्ड & lt; TheDayAfterYourEndDate

दिनांक स्वरूप स्ट्रिंग देता है और केवल प्रदर्शन उद्देश्यों के लिए है।


javascript - I am having problems with a transition effect that I am doing on a website? -


I am trying to make an impression that when I scroll out 600 px out of two pictures, then they Grow, close together. But when I do this there is no effect.

html:

  & lt; Section id = "services" class = "services-section" & gt; & Lt; Div class = "container" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-lg-12" & gt; & Lt; Div class = "container12" id = "scroll" & gt; & Lt; Img src = "img / phone.jpg" id = "phone" & gt; & Lt; Img src = "img / middle.jpg" id = "medium" & gt; & Lt; Img src = "img / tablet.jpg" id = "tablet" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Section & gt;  

CSS:

  #scroll {margin-top: 200px; Margin-down: 200px; Text align: center; } #scroll img {status: relative; }. Value (transition: 2s ease-in-out; -Mozy-infected: 2S easy-in-out; Webkit-Infection: 2s ease-in-out; } # Function .animate {conversion: translations (5em, 0); -Mozy-transition: Translation (5 AM, 0); -webkit-infection (5em, 0); } #tablet .animate {conversion: translations (-10em, 0); -Mozy-transition: Translation (-10 M, 0); -webkit-transition (-10em, 0); } # Function .animate {conversion: translations (5em, 0); -Mozy-transition: Translation (5 AM, 0); -webkit-infection (5em, 0); } #tablet .animate {conversion: translations (-10em, 0); -Mozy-transition: Translation (-10 M, 0); -webkit-transition (-10em, 0); } $ {Document} .ready (function () {$ (window) .scroll (function (event) {var y = $ (This) .scrollTop (); if (y> = 400) {$ ('# Phone'). AddClass ('Chetan'); $ ('# tablet') AddClass ('Anime');} });});  

If you can help me on this, I would be very happy. thanks for helping me.

It looks like your code is #phone and #tablet element However, your CSS has been written to handle child elements with .animate classes. Your CSS should be written as:

  # phone.animate {conversion: translations (5em, 0); -Mozy-transition: Translation (5 AM, 0); -webkit-infection (5em, 0); } # Tablet.animate {transform: translate (-10em, 0); -Mozy-transition: Translation (-10 M, 0); -webkit-transition (-10em, 0); } # Phone.animate {conversion: translations (5em, 0); -Mozy-transition: Translation (5 AM, 0); -webkit-infection (5em, 0); } # Tablet.animate {transform: translate (-10em, 0); -Mozy-transition: Translation (-10 M, 0); -webkit-transition (-10em, 0); }  

sublimetext2 - Sublime Plugin EventListener get chanes -


I want all the changes in real time on a website in a successful text editor 3 show. I would like to write a plugin that only changes the changes in an API.

Can I kind of tell the event listener on_modified what has changed? With view.change_count () I will not only get the number of changes.

  Subul, Subul_plugin class keyinglistener (defy_modified_async (see self)): print ("On-modified event removed!" + Str (view.change_count ()) );  


css - Why do Arabic text breaks into two lines sometimes? -


I have seen this strange problem many times. For some reason, on the chrome, Arabic text sometimes breaks into two rows in the middle of a word. For example, this URL:

How does this look on Chrome:

One such method (Firefox) is:

I do not know why this is happening. I think it is usable to use the overflow , but if possible, I have to know the reason.

Update: The problem is: Wrap-wrap: break-word; Removing this line in my CSS solves the problem. I still have an interest in knowing the reason.

this css

  .entry-tags li a {white- Location: nowrap; }  

This problem has been fixed.


c++ - Why can't I erase all element of vector like this? -


मेरा दुर्घटनाग्रस्त स्रोत कोड यहां था:

  #include & lt; vector & gt; नेमस्पेस एसटीडी का उपयोग करना; वेक्टर & lt; int & gt; :: इटरेटर इटर, टेम्पक; Int main () {वेक्टर & lt; int & gt; Cont (3, 5); के लिए (iter = cont.begin (); iter! = Cont.end ();) {tempIt = iter; ++ आईटीईआर; cont.erase (tempIt); } वापसी 0; }  

अंतिम तत्व को मिटाते समय यह हमेशा विफल रहता है।

से:

बिंदु के बाद या उसके बाद के संदर्भ में हेरेटर और संदर्भ

इस प्रकार विलोपन ने आपके iter iterator को अमान्य किया है, और उसके बाद आपके अपरिभाषित व्यवहार हैं।

< / div>

javascript - ScrollTop between 3 vertically aligned divs won't work from MID to BOT and glitches from BOT to MID -


Update: I have tried to remove the viewport size for some elements , And still looking for any advice for removing some features, but still facing the same behavior described in 5 steps.

I have no clue why this is happening. I have 3 divisors and a certain navigation on top of each other. I am using scrollTop: $ ("# targetDIV ") Offset (). scrollTop for each of the three divs is called from one of three .click () function; One per button

You should be able to describe in the heading title by following these steps:

  1. Click on "Mid
    < Div>
  2. Now click on the "last DIV" button and nothing should be
  3. Page
  4. "last DIV" Click on the button and you will be taken to the last device with "Final Divya Content"
  5. Now click on the "Mid Divis" button and instead click on the media div at the top level C It goes with "This is the top level"

From the top part, I can get the MID and Bot completely fine.

I highly appreciate it If you can tell me what I am missing, or possibly what could be the reason for this strange behavior.

When info_overlay is scrolled, the offset () changes in its children's top .

An optional

Could Also, since it is associated with children's ID, the offset (all children). The top is to save before saving.

"BTN" classname, you can write a click handler instead of three:

  $ ('. Inf_con_block'). Each (function () {$ (this). Data ('offset', $ (this). Offset (). Top-100);}); $ ('.inav_btn'). Click (function () {var d = '#con_' + $ (this) .attr ('class'). Split ('btn _') [1]; $ ('# info_overlay') .Mate ({scrollTop : $ (D) .data ('offset')}, 1000);});               Add  info_overlay  to scrollTop , and it will "offset" the offset (). Click on its children's top : 

  $ ('.inv_btn') (function () {var d = '#con_' + $ (this) .attr ('class 'Split (' btn_ ') [1]; $ (' #info_overlay '). Chetan ({scrollTop: ($ (d). Offset (. Top-100) + $ (' # info_overlay '). ScrollTop ()}, 1000);});  


node.js - Unable to Install node-glfw: No package 'glfw3' found -


I'm getting an error while trying to install node-gluf in my Sito 6 machine. I have already defined /usr/local/lib/pkgconfig/glfw3.pc to PKG_CONFIG_PATH

after the error is:

  NPM HTTP GET https: // Registry.npmjs .org / node-glfw npm http 304 https://registry.npmjs.org/node-glfw npm Warn Engine node-Glufff: 0.3: Wanted: {"node": "0.6.5-0.11.10" } (Current: & gt; {"node": "v0.10.33", "npm": "1.3.6"}) NPM http merges https://registry.npmjs.org/nan npm http 304 https: // Registry Npmjs.org/nan node-glfw@0.3.1 install / home / ingole / node_modules / node-glfw The node-gyp rebuilding package was not found in the glfw3 pkg-config search path. You should probably add a directory that contains a 'glfw3' traceback in the package 'glfw3.pc' PKGNNGFAGPHH Extreme Environment variable (most recent call final): file "/ usr / bin / gyp", line 18, & lt ; Module & gt; Sys.exit (gyp.main (sys.argv [1:]) file "/usr/lib/python2.6/site-packages/gyp/__init__.py", line 462, circular_check in the main option) "file / usr /lib/python2.6/site-packages/gyp/__init__.py ", line 100, load depth, generator_input_info, check, circular_check)" /usr/lib/python2.6/site-packages/gyp/ file "in the file / Usr / lib / python2.6 / site-packages / gyp / input.py ", line 388, in LoadTargetBuildFile build_file_path)" / usr / lib / python2.6 / site-package / stash / input.py ", line 1011 , ProcessVariablesAndConditionsInDict in build_file) file "/usr/lib/python2.6/site-packages/gyp/input.py", line 1026, ProcessVariablesAndConditionsInList ProcessVariablesAndConditionsInDict in (before, is_late, variable, build_file), the file "/ usr / lib / Python2.6 / site-packages / gyp / input.py ", Line 985 ProcessVariablesAndConditionsInDict ProcessConditionsInDict (the_dict, is_late, variable, build_file) in the file "/ usr /lib/python2.6/site-packages/gyp/input.py", line 862, ICT variables, build_file) procedure codes file "/ Usr / lib / python2.6 / site-packages / gyp / input.py ", line 1011, in ProcessVariablesAndConditionsInDict build_file) file" /usr/lib/python2.6/site-packages/gyp/input.py ExpandVariables / usr /lib/python2k6/site-packages/gyp/inputkpy ", line 697," line in 1030, in ProcessVariablesAndConditionsInList = ExpandVariables (before expanding is_late, variable, build_file) file "(materials, p.returncode) ) Exception: Call the position 1 returned to 'pkg-config -libs glfw3 glew'. When trying to load binding. Gp gyp ERR! Configure Error Gipple ERR! Stack error: failed with gyp` exit code: 1 GIP ERR! Stack on hair process. Copax (/usr/lib/node_modules/node-gyp/lib/configure.js:428:16) gyp ERR! Stack on childProcess.emit (events.js: 98: 17) gyp ERR! On Stack Process. Child process._hand.onexit (child_process.js: 810: 12) gyp ERR! System Linux 2.6.32-431.el6.x86_64 GIP ERR! Command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuilding" GIP ERR! Cwd / home / ingole / node_modules / node-glfw gyp ERR! Node-v v0.10.33 gip err! Node-jeep-v v0.10.6 gip err! Not right NPM ERR! Strange Error 1 NMR ERR! Code is not 0  

If you were to look at the issue of Github for node-Gluf There is an outstanding issue


javascript - I can't clear a form with .reset() -


I am trying to create a form where the user uses the item on a text box and when he "records" "Text in a list, however, I also want to make it clear how they put it in the form, when they enter (like sort Skype). Here's my jquery code.

  $ ('# inputpnote'). Keypress (function) {var keycode = (event.keyCode? Event.keyCode: event.which); if (keycode == '13') {var $ pnote = document.getElementById ("inputpnote"); if ( $ Pnote.length> gt; {$ ("# pnotes-list"). Attachments ("& lt; div class = 'Pnote-list' & gt; 
  • " + $ pnote + " & Lt; / li & gt; & lt; / div & gt; "); $ pnote.reset ();}}});
  • #inputpnote is text form and # pnotes-list , where I'm typing text. Thank you

    If #inputpnote is not a form ID, but a field ID, You will probably need to use val :

      $ ('# inputpnote'). Val ('');  

    android - how to send SMS or make a phone call from a samsung gear s app -


    I am trying to find a way to send SMS and make phone calls from the Samsung Gear S app.

    The documentation is mostly missing and searching for it does not provide too many conclusions.

    Has anyone worked with? Is this possible?

    As an alternative, if the app can not send SMS or make a call, then it is possible to start this default app (like Android Insert for SMS / Phone app or iOS Open URL).

    Thank you.

    @memical - I have found an alternate solution to launch messages / using AD ID SMS app

      & lt; P onclick = "hack sms ();" & Gt; Send SMS & lt; / P & gt; & Lt; Script & gt; Function Hack SMS () {tizen.application.launch ("com.samsung.message", function () {console.log ("Launched")}); } & Lt; / Script & gt;  

    Adding http://tizen.org/privilege/application.launch priviege in your code config.xml

    note Remember: I tried other ways to launch some predefined app controls, like using the open Tizen platform API for web apps. But it is working for the call and not for SMS.


    jquery - tracking a location using start and stop buttons using geolocation -


    rejects the failure to close the tunnel leading to the football terrace "The direct cause of 96 reasons".

    insert returns between paragraphs ► Finally add 2 spaces for line breaks ► _italic_ or ** bold ** ► Indent code by 4 spaces ► bracket migration `eg _so_` ► By quoting & gt; ► To create a link on the start of the line; & Lt; Http: //foo.com> [Foo] (http://foo.com) & lt; A href = "http://foo.com" & gt; Foo & lt; / A & gt; ► Basic HTML also allowed


    java - Hibernate, collections, save only certain properties -


    I want to map the following entities, but I ran into some problems with Hibernate.

    Organizations:

    @Entity Public Class MyObject {@Id @GeneratedValue Long ID; @column (name = "one") int intInt; Set up & lt; MapValue & gt; Map = new hashet ...} @ entity public class map value {@Id @ generatedValue long id @Column (name = "text") public string text; Public double number; }

    The value of the field "number" should be calculated after the property "text" is set

    If you want a" count "field, then the database should not be retained, annotate it with the @transient .

      @transient public double number;  

    ios - Retrieving videos uploaded from iTunes -


    I am creating an app that brings photos and videos from the library.

    I'm using the ALSATS library to get content from the library but I can not retrieve the video from this library from this library.

    I am using the following code to retrieve the content: Lift: Groups: All types of blogs: ^ (ALSSet Group * Group, Bold * Stop) {if (group || Group.numberoffetts> = 1) {[TMPSet adobject: group]; } Else {self.assetAlbums = tmpAssets; * Stop = yes; If (self.assetAlbums.count) {// analyze the content and reload, see}}} FailedTotal: ^ (NSError * error) {// failed}};

    I am getting all the other pictures and videos.

    I have used an alternative to creating a video album and filling out the content with results from ALAssetsLibraryGroupsEnumerationResultsBlock with allVideos filters.

    But the people I upload from iTunes (those who come to the video folder in the library) are not being retrieved.


    web - How to debug functional testing with intern js -



    web - How to debug functional testing with intern js -

    i new functional testing , intern. can help me functional testing of web pages require authentication i.e. web pages behind session. have installed selenium web driver , able test login page , static pages without issues.

    e.g. /myproj/login login page. able test it. when trying test /myproj/home/index browser redirecting login page. want test page should steps? code snippet create things clear.

    registersuite({ name: 'demo', 'submit form': function () { remote = this.remote; homecoming remote .get(require.tourl('https://localhost/login')) .findbyid('username') .click() .type('test') .end() .findbyid('password') .click() .type('test123') .end() .findbyname('submit') .click() .end() .then(polluntil('return document.getelementbyid("osp_homepage_metric_selection_bar");', 30000)) .findbyid('osp_show_help_popup_trigger_parent') .getvisibletext() .then(function(resulttext){ assert.equal(resulttext, '<i class=" icon-question-sign"></i>','test failed!!!'); }); }, 'landing page': function () { homecoming remote .setfindtimeout(infinity) .findbyid('show_help_popup_trigger_parent') .getvisibletext() .then(function (resulttext) { assert.equal(resulttext, '<i class=" icon-question-sign"></i>','test failed!!!'); }); } });

    thanks in advance

    manish

    one possibility utilize test server doesn't require login.

    another alternative login site in functional test. fill in username , password (or whatever utilize login) on login page , submit it:

    .findbyid('username') .type('bob123') .end() .findbyid('password') .type('somepassword') .end() .findbyid('submit') .click()

    then wait page you're interested in load , go on testing:

    .then(polluntil(...)) // go on testing

    if login process slow, may need increment timeout test using this.async.

    testing web selenium-webdriver functional-testing intern

    c# - Convert date string into date time -



    c# - Convert date string into date time -

    how convert string in format (examples shown below) datetime object. have tried several things in effort convert however, have not been able work.

    examples of strings in format:

    24 jul 2014 01 may 1988

    from first google's "c# datetime parse" result:

    string mystring = "24 jul 2014"; datetime mydatetime = datetime.parse(mystring); console.writeline(mydatetime); //24/07/2014 00:00:00

    c#

    asp.net - How do I print a formview page? -



    asp.net - How do I print a formview page? -

    i'm trying create routine print pages formview table. have routine printing gridview, same? can modified work formview changing gridview1 formview1? work when formview in readonly mode. vb language preference. help appreciated newbie.

    protected sub print_click(sender object, e system.eventargs) handles button1.click gridview1.allowpaging = false gridview1.databind() gridview1.useaccessibleheader = true gridview1.headerrow.tablesection = tablerowsection.tableheader gridview1.attributes("style") = "border-collapse:separate" each row gridviewrow in gridview1.rows if row.rowindex mod 30 = 0 andalso row.rowindex <> 0 row.attributes("style") = "page-break-after:always;" end if next dim sw new stringwriter() dim hw new htmltextwriter(sw) gridview1.rendercontrol(hw) dim gridhtml string = sw.tostring().replace("""", "'").replace(system.environment.newline, "") dim sb new stringbuilder() sb.append("<script type = 'text/javascript'>") sb.append("window.onload = new function(){") sb.append("var printwin = window.open('', '', 'left=0") sb.append(",top=0,width=1000,height=600,status=0');") sb.append("printwin.document.write(""") dim style string = "<style type = 'text/css'>thead {display:table-header-group;} tfoot{display:table-footer-group;}</style>" sb.append(style & gridhtml) sb.append(""");") sb.append("printwin.document.close();") sb.append("printwin.focus();") sb.append("printwin.print();") sb.append("printwin.close();") sb.append("};") sb.append("</script>") clientscript.registerstartupscript(me.[gettype](), "gridprint", sb.tostring()) gridview1.allowpaging = true gridview1.databind() end sub

    i trimmed/changed above next below "system.web.httpexception: command 'formview1' of type 'formview' must placed within form tag runat=server." error message , totally lost how prepare it. error comes line "formview1.rendercontrol(hw)"

    protected sub button5_click(sender object, e system.eventargs) handles button5.click formview1.allowpaging = false formview1.databind() formview1.headerrow.tablesection = tablerowsection.tableheader formview1.attributes("style") = "border-collapse:separate" dim sw new stringwriter() dim hw new htmltextwriter(sw) formview1.rendercontrol(hw) dim gridhtml string = sw.tostring().replace("""", "'").replace(system.environment.newline, "") dim sb new stringbuilder() sb.append("<script type = 'text/javascript'>") sb.append("window.onload = new function(){") sb.append("var printwin = window.open('', '', 'left=0") sb.append(",top=0,width=1000,height=600,status=0');") sb.append("printwin.document.write(""") dim style string = "<style type = 'text/css'>thead {display:table-header-group;} tfoot{display:table-footer-group;}</style>" sb.append(style & gridhtml) sb.append(""");") sb.append("printwin.document.close();") sb.append("printwin.focus();") sb.append("printwin.print();") sb.append("printwin.close();") sb.append("};") sb.append("</script>") clientscript.registerstartupscript(me.[gettype](), "gridprint", sb.tostring()) formview1.allowpaging = true formview1.databind() end sub

    it turns out needed 2 things. 1. needed add together routine vb code behind:

    public overrides sub verifyrenderinginserverform(control control) ' confirms htmlform command rendered specified asp.net server command @ run time. end sub i needed add together next aspx code header:

    enableeventvalidation = "false"

    all working , have added similar "export excel" function.

    asp.net vb.net

    nginx - Centos 7 SELinux Policy with Samba -



    nginx - Centos 7 SELinux Policy with Samba -

    my server under centos 7 has samba , nginx services installed on

    to allow web application located in /www served nginx utilize command chcon -r -t httpd_sys_content_t /www

    but in case it's impossible have permissions shared /www directory samba.

    to allow access samba's shared directory /www utilize command chcon -r -t samba_share_t /www

    at time nginx service has no access files located in /www

    i need access /www files develop web application , run nginx instantly. have no thought how create working same time having total access samba , nginx. please help, give thanks you!

    in case nginx service won't able access files under /www cause have changed file context seek label /www recursively : chcon -r -t httpd_sys_content_t /www

    then create soft link /www

    '# ln -s /www /mysambashare

    using semanage not relabel link itself; target:

    '# semanage fcontext -a -t samba_share_t /mysambashare

    nginx centos samba selinux

    android - Get only items with a pattern from sharedpreference -



    android - Get only items with a pattern from sharedpreference -

    i have values in sharedpreference in app. have items like

    itemh1 item1 itemh2 item2 itemh3 item3

    how can items itemhx?

    if stored in single preferences file, pretty much limited using sharedpreferences.getall() , iterating through map entries find keys matching pattern.

    the other alternative create different preferences file (using context.getsharedpreferences(filename, context.mode_private) special items (in example, ones h). way can read keys in file , not have check pattern.

    android

    c++: almost same input but 2nd call shows segment fault -



    c++: almost same input but 2nd call shows segment fault -

    i've been c# developer long time , seek refresh previous c++ knowledge. don't know why "root" address of sec isbalanced(root) phone call becomes 0x0. definitely, question obvious c++ developers. please, provide me hint.

    the result: 1. balanced? 0 segmentation fault: 11

    #include <iostream> using namespace std; struct node { node* left; node* right; }; int getheight(node *node) { if(node == null) homecoming 0; if(node->left == null && node->right == null) homecoming 1; int leftheight = getheight(node->left); int rightheight = getheight(node->right); if(leftheight > rightheight) homecoming 1 + leftheight; else homecoming 1 + rightheight; } bool isbalanced(node &node){ int leftheight = 0; int rightheight = 0; if(node.left == null && node.right == null) homecoming true; if(node.left != null) leftheight = getheight(node.left); if(node.right != null) rightheight = getheight(node.right); int diff = leftheight - rightheight; if(diff >= -1 && diff <= 1) { if(isbalanced(*node.left) && isbalanced(*node.right)) homecoming true; else homecoming false; } else homecoming false; } int main() { node root, n1, n2, n3, n4, n5; root.left = &n1; root.right = null; n1.left = &n2; n1.right = &n3; n2.left = null; n2.right = null; n3.left = &n4; n3.right = null; n4.right = &n5; n4.left = null; n5.right = null; n5.left = null; cout<< "1. balanced? " << isbalanced(root) << endl; root.left = &n1; root.right = &n2; n1.left = &n3; n1.right = &n4; n2.left = &n5; n2.right = null; n3.left = null; n3.right = null; n4.right = null; n4.left = null; n5.right = null; n5.left = null; cout<< "2. balanced? " << isbalanced(root) << endl; homecoming 0; }

    this line culprit.

    if(isbalanced(*node.left) && isbalanced(*node.right))

    you not checking whether node.left or node.right null before dereferencing them. first iteration works due lucky coincidence.

    here's updated version of isbalanced works me:

    bool isbalanced(node &node){ int leftheight = 0; int rightheight = 0; if(node.left == null && node.right == null) homecoming true; if(node.left != null) leftheight = getheight(node.left); if(node.right != null) rightheight = getheight(node.right); int diff = leftheight - rightheight; if(diff >= -1 && diff <= 1) { if ( node.left == null || node.right == null ) { homecoming true; } else { homecoming (isbalanced(*node.left) && isbalanced(*node.right)); } } else homecoming false; }

    c++

    java-program is not inserting all data-sets into mongodb-table -



    java-program is not inserting all data-sets into mongodb-table -

    i have next java-program, should insert 2 records in table testcoll:

    package mongodbtest; import java.net.unknownhostexception; import com.mongodb.basicdbobject; import com.mongodb.db; import com.mongodb.dbcollection; import com.mongodb.mongo; public class hellomongodb { public static void main(string[] args) { mongo mongo = null; db db=null; dbcollection table=null; // connection mongodb-server seek { mongo = new mongo("localhost", 27017); } grab (unknownhostexception e) { e.printstacktrace(); } //insert info db = mongo.getdb("testdb"); table = db.getcollection("testcoll"); //create document , insert basicdbobject document = new basicdbobject(); document.put("name", "andre"); document.put("age", 34); basicdbobject document2 = new basicdbobject(); document2.put("name", "beatrix"); document2.put("age", 19); table.insert(document); table.insert(document2); } }

    like can see, should insert 2 records collection testcoll, insert first one.

    > db.testcoll.find() { "_id" : objectid("54369b986d4b35dd1125e7ea"), "name" : "andre", "age" : 34 }

    any suggestions?

    greetings, andre

    there no problem code. can add together list of objects this!!!

    java mongodb insert

    java - invalid session for QuickFIXJ -



    java - invalid session for QuickFIXJ -

    i trying prepare connection external counterparty works on 1 server. have moved implementation onto server (on different network own firewall). can see logon messages exchanged between 2 sides (i see both in application , network layer logs). however, responding counterparty message right after logon, prepare outbound message throws exception complaining there no valid session send message on. not see resets in network logs before (the reset occurs when above event occurs after quickfixj app sends logout). heartbeat interval set 30 seconds per counterparty instructions - exception happens within sec of logon response. same config works on different server (on not have firewall rules). ideas might causing , if network related, best approach confirm that?

    update: issue related faulty logic on end - have fixed on end. session id not beingness populated before beingness accessed.

    java quickfixj

    javascript - Add `destroy` method to Snap.js mobile panel plugin -



    javascript - Add `destroy` method to Snap.js mobile panel plugin -

    how add together destroy method snap.js mobile panel? if it's matter of removing info / references set, best way of going that?

    https://rawgit.com/jakiestfu/snap.js/v2.0.0-rc1/src/snap.js

    basically need able shut downwards before reinitializing on jquery mobile page change -- otherwise work on first page:

    http://jsfiddle.net/frank_o/l3dkmkrx/1/

    the below code clones snap panel, places before current page , initialize on pagecontainershow.

    $(document).on("pagecontainershow", function (e, data) { var drawer = $(".snap-drawers").clone(); /* clone */ $(".snap-drawers").remove(); /* remove */ $(data.topage).before(drawer); /* place before page */ var snapper = new snap({ element: $(data.topage)[0] /* initialize */ }); $('.open-panel') .off("click") /* remove previous click listener */ .on("click", function () { /* re-bind click */ snapper.open('left'); }); $('.close') .off("click") /* remove previous click listener */ .on('click', function () { /* re-bind click */ snapper.close(); }); });

    demo - code

    javascript jquery jquery-mobile

    sql server - Static ADO recordset returns RecordCount -1 when using common table expressions -



    sql server - Static ADO recordset returns RecordCount -1 when using common table expressions -

    according documentation, recordset.recordcount supposed homecoming actual number of rows when using static recordset (emphasis mine):

    the recordcount property homecoming -1 forward-only cursor; the actual count static or keyset cursor; , either -1 or actual count dynamic cursor, depending on info source.

    however, apparently untrue when using sqloledb provider , sql statement includes mutual table expression:

    const sql1 = "select myfield mytable" const sql2 = "with mycte (select myfield mytable) select myfield mytable" dim cn new adodb.connection cn.open "provider=sqloledb;server=myserver;initial catalog=mydatabase;integrated security=sspi" dim rs new adodb.recordset rs.cursorlocation = aduseserver rs.open sql1, cn, adopenstatic, adlockreadonly, adcmdtext debug.print rs.recordcount ' yields 156 ' rs.close rs.open sql2, cn, adopenstatic, adlockreadonly, adcmdtext debug.print rs.recordcount ' yields -1; should 156 ' rs.close cn.close

    is known issue?

    i aware can work around issue using client-side instead of (default) server-side cursor, i'd rather not avoid introducing regressions in our legacy code.

    in sec case, ado not create static cursor. apparently, ole db provider not back upwards server-side static cursors ctes , changes cursor type adopenforwardonly. forward-only cursors homecoming -1 recordcount.

    credit discovering goes dan guzman.

    sql-server vba oledb ado

    javascript - Change display according to an option selected on top of a columnJQchart -



    javascript - Change display according to an option selected on top of a columnJQchart -

    i need 3 radio button fields displaying yearly , monthly , weekly info on column chart when select either of alternative display should accordingly. found lot of examples in jqchart different types of displays couldn't find illustration this. there other alternative replacing radio button here? please help

    your best bet have 3 series of data, 1 time each. can swap out series using listener on radio buttons.

    essentially:

    <input type="radio" name="data" id="yearly" class="radioselector" value="yearly">yearly<br> <input type="radio" name="data" id="monthly" class="radioselector" value="monthly">monthly<br> <input type="radio" name="data" id="daily" class="radioselector" value="daily">daily <script> $('.radioselector').click(function (event) { // set target id var id = $(event.target).attr('id'); // current series var series = $('#jqchart').jqchart('option', 'series'); // check radio switch (id) { case 'yearly': series = yearlydata; break; case 'monthly': series = monthlydata; break; case 'daily': series = dailydata; break; } // update (redraw) chart $('#jqchart').jqchart('update'); }); </script>

    javascript jquery html5 jqchart

    javascript Convert string representation of hex value to hex -



    javascript Convert string representation of hex value to hex -

    in javascript, how convert string representation of hex value it's hex representation ?

    what have returning checksum routine string value "fe". need it's hex representation "\xfe"

    i cannot this, gives me error:

    var crc = "fe"; var hex = "\x" + crc;

    this gives me new 4 character ascii string:

    var crc = "fe"; var hex = "0x" + "fe";

    thxs guidance.

    like this

    var hex = parseint("ff", 16);

    javascript string hex

    How do you make an array of strings in C? -



    How do you make an array of strings in C? -

    so far way can create code work switch statements. there way can take away switch statement , create array. heard can do: char name[11]= {"name 1", "name 2"}; , on i'm not sure how print later on in program. because numbers assigned non-array variable , used printf print it.

    my code:

    #include <stdio.h> int main(){ int i; int player [11] = {1, 2, 10, 13, 21, 22, 24, 25, 31,32, 33}; int points [11] = {60, 297, 11, 373, 154, 52, 555, 218, 29, 242, 257}; int games [11] = {33, 35, 12, 35, 35, 35, 35, 35, 22,35, 35}; int bestplayer = 0; float bestppg = 0.0; float ppg [11] ; (i=0; i<11; i++){ ppg[i] = (float)points [i] / (float)games [i] ; printf("%d \t %d \t %d \t %.1f ppg\n", player[i], games[i], points[i],ppg[i]); if (ppg[i]>bestplayer){ bestplayer = player[i]; bestppg = ppg[i]; } } printf("\nthe player points per game #%d ", bestplayer); switch(bestplayer){ case 1: printf("player 1"); break; case 2: printf("player 2"); break; case 10: printf("player 3"); break; case 13: printf("player 4"); break; case 21: printf("player 5"); break; case 22: printf("player 6"); break; case 24: printf("player 7"); break; case 25: printf("player 8"); break; case 31: printf("player 9"); break; case 32: printf("player 10"); break; case 33: printf("player 11"); break; default: printf("invalid player"); break; } printf(" %.1f ppg.\n",bestppg); homecoming 0; }

    the main problem using array of char* in current construction don't track index of best player. if this, can create array , index it.

    #include <stdio.h> int main(){ int i; int player [11] = {1, 2, 10, 13, 21, 22, 24, 25, 31,32, 33}; int points [11] = {60, 297, 11, 373, 154, 52, 555, 218, 29, 242, 257}; int games [11] = {33, 35, 12, 35, 35, 35, 35, 35, 22,35, 35}; const char* names[11] = { "jaylon tate","joseph bertrand","jaylon tate","tracy abrams","malcolm hill","maverick morgan","rayvonte rice","kendrick nunn","austin colbert","nnanna egwu","jon ekey" }; int bestplayer = 0; float bestppg = 0.0; float ppg [11] ; int bestindex = 0; (i=0; i<11; i++){ ppg[i] = (float)points [i] / (float)games [i] ; printf("%d \t %d \t %d \t %.1f ppg\n", player[i], games[i], points[i],ppg[i]); if (ppg[i]>bestplayer){ bestplayer = player[i]; bestppg = ppg[i]; bestindex = i; } } printf("\nthe player points per game #%d %s %.1f ppg.\n", bestplayer, names[bestindex], bestppg); homecoming 0; }

    c arrays string

    scala - Shapeless case study -



    scala - Shapeless case study -

    in application, have bunch of components capable of rendering html:

    class standardcomponent { def render: html }

    they instantiated @ run-time componentdefinition objects componentbuilder, provides access run-time data:

    class componentbuilder { def makecomponent(componentdef: componentdefinition): standardcomponent }

    then there several helpers facilitate rendering of sub-components within components:

    def fromcomponent(componentdef: componentdefinition)(htmlfn: html => future[html])(implicit componentbuilder: componentbuilder): future[html] def fromcomponents(componentdefs: seq[componentdefinition])(htmlfn: seq[html] => future[html])(implicit componentbuilder: componentbuilder): future[html] def fromoptionalcomponent(componentdefopt: option[componentdefinition])(htmlfn: option[html] => future[html])(implicit componentbuilder: componentbuilder): future[html] def fromcomponentmap[k](componentdefmap: map[k, componentdefinition])(htmlfn: map[k, html] => future[html])(implicit componentbuilder: componentbuilder): future[html]

    the problem oftentimes, component needs utilize several of these from* calls. although designed nestable, can turn bit of mess:

    implicit val componentbuilder: componentbuilder = ??? val subcomponent: componentdefinition = ??? val subcomponents: seq[componentdefinition] = ??? val subcomponentopt: option[componentdefinition] = ??? fromcomponent(subcomponent) { html => fromcomoponents(subcomponents) { htmls => fromoptionalcomponent(subcomponentopt) { opthtml => ??? } } }

    what i'd able like:

    withsubcomponents( subcomponent, subcomponents, subcomponentopt ) { case (html, htmls, opthtml) => /* html, seq[html], , option[html] */ ??? }

    so, want create withsubcomponents variadic in arguments, , want create closure takes in sec argument list have argument list depends on first argument list in arity , type. ideally, takes implicit componentbuilder, individual helpers do. that's ideal syntax, i'm open alternatives. provide examples of have far, have ideas far. feels need create hlist of coproduct, , need way tie 2 arguments together.

    the first step in improving dsl can move methods implicit conversion this:

    implicit class subcomponentenhancements[t](subcomponent: t)( implicit cb: componentbuilder[t]) { def fromcomponent(f: cb.htmltype => future[html]): future[html] = ??? }

    note declared fromcomponent valid each type t has componentbuilder defined. can see imagined componentbuilder have htmltype. in illustration seq[html], option[html], etc. componentbuilder looks this:

    trait componentbuilder[t] { type htmltype def render(componentdef: t): htmltype }

    i imagined componentbuilder able render component type of html. let's declare component builders able phone call fromcomponent method on different types.

    object componentbuilder { implicit def single = new componentbuilder[componentdefinition] { type htmltype = html def render(componentdef: componentdefinition) = { // create standard component component definition val standardcomponent = new standardcomponent standardcomponent.render } } implicit def seq[t]( implicit cb: componentbuilder[t]) = new componentbuilder[seq[t]] { type htmltype = seq[cb.htmltype] def render(componentdef: seq[t]) = componentdef.map(c => cb.render(c)) } implicit def option[t]( implicit cb: componentbuilder[t]) = new componentbuilder[option[t]] { type htmltype = option[cb.htmltype] def render(componentdef: option[t]) = componentdef.map(c => cb.render(c)) } }

    notice each of component builders specifies htmltype in sync type of componentbuilder. builders container types request component builder contents. allows nest different combinations without much effort. generalize concept further, fine.

    as single component builder, define more generically, allowing have different types of component definitions. converting them standard component done using converter located in serveral different places (companion object of x, companion object of converter or separate object users need import manually).

    trait converter[x] { def convert(c:x):standardcomponent } object componentdefinition { implicit val defaultconverter = new converter[componentdefinition] { def convert(c: componentdefinition):standardcomponent = ??? } } implicit def single[x](implicit converter: converter[x]) = new componentbuilder[x] { type htmltype = html def render(componentdef: x) = converter.convert(componentdef).render }

    anyway, code looks following:

    subcomponent fromcomponent { html => subcomponents fromcomponent { htmls => subcomponentopt fromcomponent { opthtml => ??? } } }

    this looks familiar pattern, let's rename methods:

    subcomponent flatmap { html => subcomponents flatmap { htmls => subcomponentopt map { opthtml => ??? } } }

    note in wishful thinking space, above code not compile. if had way of making compile write following:

    for { html <- subcomponent htmls <- subcomponents opthtml <- subcomponentopt } yield ???

    that looks pretty amazing me, unfortunately option , seq have flatmap function themselves, need hide those. next code looks clean , gives oportunity hide flatmap , map methods.

    trait wrapper[+a] { def map[b](f:a => b):wrapper[b] def flatmap[b](f:a => wrapper[b]):wrapper[b] } implicit class htmlenhancement[t](subcomponent:t) { def html:wrapper[t] = ??? } { html <- subcomponent.html htmls <- subcomponents.html opthtml <- subcomponentopt.html } yield ???

    as can see still in wishful thinking space, let's see if can fill in blanks.

    case class wrapper[+a](value: a) { def map[b](f: => b) = wrapper(f(value)) def flatmap[b](f: => wrapper[b]) = f(value) } implicit class htmlenhancement[t](subcomponent: t)( implicit val cb: componentbuilder[t]) { def html: wrapper[cb.htmltype] = wrapper(cb.render(subcomponent)) }

    the implementation not complicated because can utilize tools created earlier. note during wishful thinking returned wrapper[t] while needed html, using htmltype component builder.

    to improve type inference, alter componentbuilder slightly. alter htmltype type fellow member type parameter.

    trait componentbuilder[t, r] { def render(componentdef: t): r } implicit class htmlenhancement[t, r](subcomponent: t)( implicit val cb: componentbuilder[t, r]) { def html:wrapper[r] = wrapper(cb.render(subcomponent)) }

    the different builders need alter well

    object componentbuilder { implicit def single[x](implicit converter: converter[x]) = new componentbuilder[x, html] { def render(componentdef: x) = converter.convert(componentdef).render } implicit def seq[t, r]( implicit cb: componentbuilder[t, r]) = new componentbuilder[seq[t], seq[r]] { def render(componentdef: seq[t]) = componentdef.map(c => cb.render(c)) } implicit def option[t, r]( implicit cb: componentbuilder[t, r]) = new componentbuilder[option[t], option[r]] { def render(componentdef: option[t]) = componentdef.map(c => cb.render(c)) } }

    the end result looks this:

    val wrappedhtml = { html <- subcomponent.html htmls <- subcomponents.html opthtml <- subcomponentopt.html } yield { // interesting stuff html htmls ++ opthtml.toseq :+ html } // type of `result` `seq[html]` val result = wrappedhtml.value // or val wrapper(result) = wrappedhtml

    as might have noticed, skipped future, can add together please.

    i not sure if how envisioned dsl, @ to the lowest degree gives tools create cool one.

    scala shapeless

    java - Read HttpServletResponse headers and body in Apache Camel jetty component -



    java - Read HttpServletResponse headers and body in Apache Camel jetty component -

    i trying create http proxy server using apache camel jetty component. next code -

    from("jetty:http://localhost:8080?matchonuriprefix=true") .process(new processor() { public void process(exchange exchange) throws exception { httpservletrequest req = exchange.getin().getbody( httpservletrequest.class); enumeration<string> headers = request.getheadernames(); while (headers.hasmoreelements()) { string headername = headers.nextelement(); string headervalue = request.getheader(headername); } inputstream stream = request.getinputstream(); int bytesread; string line = ""; byte b[] = new byte[1024]; while ((bytesread = stream.read(b)) != -1) { line = line + new string(b, 0, bytesread); } }) .to("http://www.google.com:80?bridgeendpoint=true&amp;throwexceptiononfailure=false") .process(new processor() { public void process(exchange exchange) throws exception { httpservletresponse res = exchange.getin().getbody( httpservletresponse.class); });

    i able read httpservletrequest headers , data. however, not able read httpservletresponse info there no getinputstream() method in httpservletresponse. found post related problem said either have subclass httpservletresponse or create filter. in apache camel, not straight interacting httpservletresponse class how can sub class or create filter

    please help me resolve problem.

    java servlets jetty apache-camel proxy-server