Daily Archives

Articles indexed Thursday August 21 2014

Page 9/19 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Trigger an action to increment all rows of an int column which are greater than or equal to the inserted row

    - by Dev
    I am performing some insertion to an SQL table with has three columns and several rows of data The three columns are Id,Product,ProductOrder with the following data Id Product ProductOrder 1 Dell 1 2 HP 3 3 lenovo 2 4 Apple 10 Now, I would like a trigger which fires an action and increments all the ProductOrders by 1which are greater than or equal to the inserted ProductOrder. For example, I am inserting a record with Id=5 Product=Sony, ProductOrder=2 Then it should look for all the products with ProductOrder greater than or equal to 2 and increment them by 1. So, the resultant data in the SQL table should be as follows Id Product ProductOrder 1 Dell 1 2 HP 4 3 lenovo 3 4 Apple 11 5 Sony 2 From above we can see that ProductOrder which are equal or greater than the inserted are incremented by 1 like HP,Lenovo,Apple May I know a way to implement this?

    Read the article

  • Failing faster when URL content is not found, howto

    - by Jam
    I have a thread pool that loops over a bunch of pages and checks to see if some string is there or not. If String is found, or not found response is near instant, however if server is offline or application is not running getting a rejection seems to take seconds How can I change my code to fail faster? for (Thread thread : pool) { thread.start(); } for (Thread thread : pool) { try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } Here is my run method @Override public void run() { for (Box b : boxes) { try { connection = new URL(b.getUrl()).openConnection(); scanner = new Scanner(connection.getInputStream()); scanner.useDelimiter("\\Z"); content = scanner.next(); if (content.equals("YES")) { } else { System.out.println("\tFAILED ON " + b.getName() + " BAD APPLICATION STATE"); } } catch (Exception ex) { System.out.println("\tFAILED ON " + b.getName() + " BAD APPLICATION STATE"); } } }

    Read the article

  • jsonp callback error and parserror

    - by Fatima Zahrae Abbadi
    im devlopping web app with javascript/html5 client side and im using web service rest in the server i want to get json data from the server and i have problem of cross domain and i use JSONP the problme that i had the callback was not called this is the code of REST @GET @Path("agenda") @Produces({MediaType.APPLICATION_JSON}) public List<AgendaChambre> getAgenda() { ArrayList<AgendaChambre>list=new ArrayList<>(); return agenda.findAll(); } and function getdata(){ $.ajax({ type: "GET", dataType:"jsonp", crossDomain: true, url: "http://localhost:8080/wsccm/res/ws/agenda?jsoncallback=?", data: {name: "George Koch"}, jsonpCallback: 'successCallback', success: function(data1) { getdata=JSON.stringify(data1); alert("bieeeeeeeeeeeeeeeeen"); console.log("response:" + getdata); }, error: function(jqXHR, textStatus, errorThrown) { alert('error'+errorThrown); console.log(jqXHR); } });

    Read the article

  • Django: name of many to many items in the admin interface

    - by Adam
    I have a many to many field, which I'm displaying in the django admin panel. When I add multiple items, they all come up as "ASGGroup object" in the display selector. Instead, I want them to come up as whatever the ASGGroup.name field is set to. How do I do this? My models looks like: class Thing(Model): read_groups = ManyToManyField('ASGGroup', related_name="thing_read", blank=True) class ASGGroup(Model): name = CharField(max_length=63, null=True) But what I'm seeing the m2m widget display is:

    Read the article

  • Laravel 4 showing all field from one to one relationship in

    - by rivai04
    I'm trying to show all field of the chosen row from one to one relationship... Route Route::get('relasi-pasien', function() { $pasien = PasienIri::where('no_ipd', '=', '100')->first(); foreach($pasien->keadaanumum as $temp) { echo'<li> Name : '.$temp->name. 'Tekdar: '.$temp->tekdar. 'Nadi : '.$temp->nadi. '</li>'; } }); Relation at PasienIri's model public function keadaanumum() { return $this->hasOne('KeadaanUmum', 'no_ipd'); } Relation at KeadaanUmum's Model public function pasieniri() { return $this->belongsTo('PasienIri', 'no_ipd'); } When I used that way, it showed error: 'Trying to get property of non-object' But if I just trying to show only one of the field, it works, showing one field: Route::get('relasi-pasien', function() { $pasien = PasienIri::where('no_ipd', '=', '100')->first(); return $pasien->keadaanumum->name; }); anyone could help me to show all field with one to one relationship or I really have to change it to one to many relationship? cause if I change it to one to many relationship, it works

    Read the article

  • Save HashMap data into SQLite

    - by Matthew
    I'm Trying to save data from Json into SQLite. For now I keep the data from Json into HashMap. I already search it, and there's said use the ContentValues. But I still don't get it how to use it. I try looking at this question save data to SQLite from json object using Hashmap in Android, but it doesn't help a lot. Is there any option that I can use to save the data from HashMap into SQLite? Here's My code. MainHellobali.java // Hashmap for ListView ArrayList<HashMap<String, String>> all_itemList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_helloballi); all_itemList = new ArrayList<HashMap<String, String>>(); // Calling async task to get json new getAllItem().execute(); } private class getAllItem extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... arg0) { // Creating service handler class instance ServiceHandler sh = new ServiceHandler(); // Making a request to url and getting response String jsonStr = sh.makeServiceCall(url, ServiceHandler.GET); Log.d("Response: ", "> " + jsonStr); if (jsonStr != null) { try { all_item = new JSONArray(jsonStr); // looping through All Contacts for (int i = 0; i < all_item.length(); i++) { JSONObject c = all_item.getJSONObject(i); String item_id = c.getString(TAG_ITEM_ID); String category_name = c.getString(TAG_CATEGORY_NAME); String item_name = c.getString(TAG_ITEM_NAME); // tmp hashmap for single contact HashMap<String, String> allItem = new HashMap<String, String>(); // adding each child node to HashMap key => value allItem.put(TAG_ITEM_ID, item_id); allItem.put(TAG_CATEGORY_NAME, category_name); allItem.put(TAG_ITEM_NAME, item_name); // adding contact to contact list all_itemList.add(allItem); } } catch (JSONException e) { e.printStackTrace(); } } else { Log.e("ServiceHandler", "Couldn't get any data from the url"); } return null; } } I have DatabasehHandler.java and AllItem.java too. I can put it in here if its necessary. Thanks before ** Add Edited Code ** // looping through All Contacts for (int i = 0; i < all_item.length(); i++) { JSONObject c = all_item.getJSONObject(i); String item_id = c.getString(TAG_ITEM_ID); String category_name = c.getString(TAG_CATEGORY_NAME); String item_name = c.getString(TAG_ITEM_NAME); DatabaseHandler databaseHandler = new DatabaseHandler(this); //error here "The Constructor DatabaseHandler(MainHellobali.getAllItem) is undefined }

    Read the article

  • Instagram API and Zend/Loader.php

    - by Jaemin Kim
    I want to use Instagram API and I found this code. <html> <head></head> <body> <h1>Popular on Instagram</h1> <?php // load Zend classes require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Http_Client'); // define consumer key and secret // available from Instagram API console $CLIENT_ID = 'YOUR-CLIENT-ID'; $CLIENT_SECRET = 'YOUR-CLIENT-SECRET'; try { // initialize client $client = new Zend_Http_Client('https://api.instagram.com/v1/media/popular'); $client->setParameterGet('client_id', $CLIENT_ID); // get popular images // transmit request and decode response $response = $client->request(); $result = json_decode($response->getBody()); // display images $data = $result->data; if (count($data) > 0) { echo '<ul>'; foreach ($data as $item) { echo '<li style="display: inline-block; padding: 25px"><a href="' . $item->link . '"><img src="' . $item->images->thumbnail->url . '" /></a> <br/>'; echo 'By: <em>' . $item->user->username . '</em> <br/>'; echo 'Date: ' . date ('d M Y h:i:s', $item->created_time) . '<br/>'; echo $item->comments->count . ' comment(s). ' . $item->likes->count . ' likes. </li>'; } echo '</ul>'; } } catch (Exception $e) { echo 'ERROR: ' . $e->getMessage() . print_r($client); exit; } ?> </body> </html> In here, I found Zender/Load.php, and I've never heard about that. Is it okay to go http://www.zend.com/en/products/guard/downloads here, and download Zend for linux?? And for another question, is this code available to use Instagram API?? For last, could you let me know that is there any simple code to use Instagram API? Thank you.

    Read the article

  • Perl - Reading .txt files line-by-line and using compare function (printing non-matches only once)

    - by Kurt W
    I am really struggling and have spent about two full days on this banging my head against receiving the same result every time I run this perl script. I have a Perl script that connects to a vendor tool and stores data for ~26 different elements within @data. There is a foreach loop for @data that breaks the 26 elements into $e-{'element1'), $e-{'element2'), $e-{'element3'), $e-{'element4'), etc. etc. etc. I am also reading from the .txt files within a directory (line-by-line) and comparing the server names that exist within the text files with what exists in $e-{'element4'}. The Problem: Matches are working perfectly and only printing one line for each of the 26 elements when there is a match, however non-matches are producing one line for every entry within the .txt files (37 in all). So if there are 100 entries (each entry having 26 elements) stored within @data, then there are 100 x 37 entries being printed. So for every non-match in the: if ($e-{'element4'} eq '6' && $_ =~ /$e-{element7}/i) statement below, I am receiving a print out saying that there is not a match. 37 entries for the same identical 26 elements (because there are 37 total entries in all of the .txt files). The Goal: I need to print out only 1 line for each unique entry (a unique entry being $e-{element1} thru $e-{element26}). It is already printing one 1 line for matches, but it is printing out 37 entries when there is not a match. I need to treat matches and non-matches differently. Code: foreach my $e (@data) { # Open the .txt files stored within $basePath and use for comparison: opendir(DIRC, $basePath . "/") || die ("cannot open directory"); my @files=(readdir(DIRC)); my @MPG_assets = grep(/(.*?).txt/, @files); # Loop through each system name found and compare it with the data in SC for a match: foreach(@MPG_assets) { $filename = $_; open (MPGFILES, $basePath . "/" . $filename) || die "canot open the file"; while(<MPGFILES>) { if ($e->{'element4'} eq '6' && $_ =~ /$e->{'element7'}/i) { ## THIS SECTION WORKS PERFECTLY AND ONLY PRINTS MATCHES WHERE $_ ## (which contains the servernames (1 per line) in the .txt files) ## EQUALS $e->{'element7'}. print $e->{'element1'} . "\n"; print $e->{'element2'} . "\n"; print $e->{'element3'} . "\n"; print $e->{'element4'} . "\n"; print $e->{'element5'} . "\n"; # ... print $e->{'element26'} . "\n"; } else { ## **THIS SECTION DOES NOT WORK**. FOR EVERY NON-MATCH, THERE IS A ## LINE PRINTED WITH 26 IDENTICAL ELEMENTS BECAUSE ITS LOOPING THRU ## THE 37 LINES IN THE *.TXT FILES. print $e->{'element1'} . "\n"; print $e->{'element2'} . "\n"; print $e->{'element3'} . "\n"; print $e->{'element4'} . "\n"; print $e->{'element5'} . "\n"; # ... print $e->{'element26'} . "\n"; } # End of 'if ($e->{'element4'} eq..' statement } # End of while loop } # End of 'foreach(@MPG_assets)' } # End of 'foreach my $e (@data)' I think I need something to identical unique elements and define what fields make up a unique element but honestly I have tried everything I know. If you would be so kind to provide actual code fixes, that would be wonderful because I am headed to production with this script quite soon. Also. I am looking for code (ideally) that is very human-readable because I will need to document it so others can understand. Please let me know if you need additional information.

    Read the article

  • Parsing csv line to Java objects

    - by Noobling
    I was wondering if someone here could help me, I can't find a solution for my problem and I have tried everything. What I am trying to do is read and parse lines in a csv file into java objects and I have succeeded in doing that but after it reads all the lines it should insert the lines into the database but it only inserts the 1st line the entire time and I don't no why. When I do a print it shows that it is reading all the lines and placing them in the objects but as soon as I do the insert it wants to insert only the 1st line. Please see my code below: public boolean lineReader(File file){ BufferedReader br = null; String line= ""; String splitBy = ","; storeList = new ArrayList<StoreFile>(); try { br = new BufferedReader(new FileReader(file)); while((line = br.readLine())!=null){ line = line.replace('|', ','); //split on pipe ( | ) String[] array = line.split(splitBy, 14); //Add values from csv to store object //Add values from csv to storeF objects StoreFile StoreF = new StoreFile(); if (array[0].equals("H") || array[0].equals("T")) { return false; } else { StoreF.setRetailID(array[1].replaceAll("/", "")); StoreF.setChain(array[2].replaceAll("/","")); StoreF.setStoreID(array[3].replaceAll("/", "")); StoreF.setStoreName(array[4].replaceAll("/", "")); StoreF.setAddress1(array[5].replaceAll("/", "")); StoreF.setAddress2(array[6].replaceAll("/", "")); StoreF.setAddress3(array[7].replaceAll("/", "")); StoreF.setProvince(array[8].replaceAll("/", "")); StoreF.setAddress4(array[9].replaceAll("/", "")); StoreF.setCountry(array[10].replaceAll("/", "")); StoreF.setCurrency(array[11].replaceAll("/", "")); StoreF.setAddress5(array[12].replaceAll("/", "")); StoreF.setTelNo(array[13].replaceAll("/", "")); //Add stores to list storeList.add(StoreF); } } //print list stores in file printStoreList(storeList); executeStoredPro(storeList); } catch (Exception ex) { nmtbatchservice.NMTBatchService2.LOG.error("An exception accoured: " + ex.getMessage(), ex); //copy to error folder //email } return false; } public void printStoreList(List<StoreFile> storeListToPrint) { for(int i = 0; i <storeListToPrint.size();i++){ System.out.println( storeListToPrint.get(i).getRetailID() + storeListToPrint.get(i).getChain() + storeListToPrint.get(i).getStoreID() + storeListToPrint.get(i).getStoreName() + storeListToPrint.get(i).getAddress1() + storeListToPrint.get(i).getAddress2() + storeListToPrint.get(i).getAddress3() + storeListToPrint.get(i).getProvince() + storeListToPrint.get(i).getAddress4() + storeListToPrint.get(i).getCountry() + storeListToPrint.get(i).getCurrency() + storeListToPrint.get(i).getAddress5() + storeListToPrint.get(i).getTelNo()); } } public void unzip(String source, String destination) { try { ZipFile zipFile = new ZipFile(source); zipFile.extractAll(destination); deleteStoreFile(source); } catch (ZipException ex) { nmtbatchservice.NMTBatchService2.LOG.error("Error unzipping file : " + ex.getMessage(), ex); } } public void deleteStoreFile(String directory) { try { File file = new File(directory); file.delete(); } catch (Exception ex) { nmtbatchservice.NMTBatchService2.LOG.error("An exception accoured when trying to delete file " + directory + " : " + ex.getMessage(), ex); } } public void executeStoredPro(List<StoreFile> storeListToInsert) { Connection con = null; CallableStatement st = null; try { String connectionURL = MSSQLConnectionURL; Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance(); con = DriverManager.getConnection(connectionURL, MSSQLUsername, MSSQLPassword); for(int i = 0; i <storeListToInsert.size();i++){ st = con.prepareCall( "IF EXISTS (SELECT * FROM tblPay@RetailStores WHERE StoreID = " + storeListToInsert.get(i).getStoreID() + " AND RetailID = "+ storeListToInsert.get(i).getRetailID() + ")" + " UPDATE tblPay@RetailStores " + " SET RetailID = '" + storeListToInsert.get(i).getRetailID() + "'," + " StoreID = '" + storeListToInsert.get(i).getStoreID() + "'," + " StoreName = '" + storeListToInsert.get(i).getStoreName() + "'," + " TestStore = 0," + " Address1 = '" + storeListToInsert.get(i).getAddress1() + "'," + " Address2 = '" + storeListToInsert.get(i).getAddress2() + "'," + " Address3 = '" + storeListToInsert.get(i).getAddress3() + "'," + " Address4 = '" + storeListToInsert.get(i).getAddress4() + "'," + " Address5 = '" + storeListToInsert.get(i).getAddress5() + "'," + " Province = '" + storeListToInsert.get(i).getProvince() + "'," + " TelNo = '" + storeListToInsert.get(i).getTelNo() + "'," + " Enabled = 1" + " ELSE " + " INSERT INTO tblPay@RetailStores ( [RetailID], [StoreID], [StoreName], [TestStore], [Address1], [Address2], [Address3], [Address4], [Address5], [Province], [TelNo] , [Enabled] ) " + " VALUES " + "('" + storeListToInsert.get(i).getRetailID() + "'," + "'" + storeListToInsert.get(i).getStoreID() + "'," + "'" + storeListToInsert.get(i).getStoreName() + "'," + "0," + "'" + storeListToInsert.get(i).getAddress1() + "'," + "'" + storeListToInsert.get(i).getAddress2() + "'," + "'" + storeListToInsert.get(i).getAddress3() + "'," + "'" + storeListToInsert.get(i).getAddress4() + "'," + "'" + storeListToInsert.get(i).getAddress5() + "'," + "'" + storeListToInsert.get(i).getProvince() + "'," + "'" + storeListToInsert.get(i).getTelNo() + "'," + "1)"); st.executeUpdate(); } con.close(); } catch (Exception ex) { nmtbatchservice.NMTBatchService2.LOG.error("Error executing Stored proc with error : " + ex.getMessage(), ex); nmtbatchservice.NMTBatchService2.mailingQueue.addToQueue(new Mail("[email protected]", "Service Email Error", "An error occurred during Store Import failed with error : " + ex.getMessage())); } } Any advise would be appreciated. Thanks

    Read the article

  • SpringBatch Jaxb2Marshaller: different name of class and xml attribute

    - by user588961
    I try to read an xml file as input for spring batch: Java Class: package de.example.schema.processes.standardprocess; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Process", namespace = "http://schema.example.de/processes/process", propOrder = { "input" }) public class Process implements Serializable { @XmlElement(namespace = "http://schema.example.de/processes/process") protected ProcessInput input; public ProcessInput getInput() { return input; } public void setInput(ProcessInput value) { this.input = value; } } SpringBatch dev-job.xml: <bean id="exampleReader" class="org.springframework.batch.item.xml.StaxEventItemReader" scope="step"> <property name="fragmentRootElementName" value="input" /> <property name="resource" value="file:#{jobParameters['dateiname']}" /> <property name="unmarshaller" ref="jaxb2Marshaller" /> </bean> <bean id="jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="classesToBeBound"> <list> <value>de.example.schema.processes.standardprocess.Process</value> <value>de.example.schema.processes.standardprocess.ProcessInput</value> ... </list> </property> </bean> Input file: <?xml version="1.0" encoding="UTF-8"?> <process:process xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:process="http://schema.example.de/processes/process"> <process:input> ... </process:input> </process:process> It fires the following exception: [javax.xml.bind.UnmarshalException: unexpected element (uri:"http://schema.example.de/processes/process", local:"input"). Expected elements are <<{http://schema.example.de/processes/process}processInput] at org.springframework.oxm.jaxb.JaxbUtils.convertJaxbException(JaxbUtils.java:92) at org.springframework.oxm.jaxb.AbstractJaxbMarshaller.convertJaxbException(AbstractJaxbMarshaller.java:143) at org.springframework.oxm.jaxb.Jaxb2Marshaller.unmarshal(Jaxb2Marshaller.java:428) If I change to in xml it work's fine. Unfortunately I can change neither the xml nor the java class. Is there a possibility to make Jaxb2Marshaller map the element 'input' to the class 'ProcessInput'?

    Read the article

  • Not sure what happens to my apps objects when using NSURLSession in background - what state is my app in?

    - by Avner Barr
    More of a general question - I don't understand the workings of NSURLSession when using it in "background session mode". I will supply some simple contrived example code. I have a database which holds objects - such that portions of this data can be uploaded to a remote server. It is important to know which data/objects were uploaded in order to accurately display information to the user. It is also important to be able to upload to the server in a background task because the app can be killed at any point. for instance a simple profile picture object: @interface ProfilePicture : NSObject @property int userId; @property UIImage *profilePicture; @property BOOL successfullyUploaded; // we want to know if the image was uploaded to out server - this could also be a property that is queryable but lets assume this is attached to this object @end Now Lets say I want to upload the profile picture to a remote server - I could do something like: @implementation ProfilePictureUploader -(void)uploadProfilePicture:(ProfilePicture *)profilePicture completion:(void(^)(BOOL successInUploading))completion { NSUrlSession *uploadImageSession = ..... // code to setup uploading the image - and calling the completion handler; [uploadImageSession resume]; } @end Now somewhere else in my code I want to upload the profile picture - and if it was successful update the UI and the database that this action happened: ProfilePicture *aNewProfilePicture = ...; aNewProfilePicture.profilePicture = aImage; aNewProfilePicture.userId = 123; aNewProfilePicture.successfullyUploaded = NO; // write the change to disk [MyDatabase write:aNewProfilePicture]; // upload the image to the server ProfilePictureUploader *uploader = [ProfilePictureUploader ....]; [uploader uploadProfilePicture:aNewProfilePicture completion:^(BOOL successInUploading) { if (successInUploading) { // persist the change to my db. aNewProfilePicture.successfullyUploaded = YES; [Mydase update:aNewProfilePicture]; // persist the change } }]; Now obviously if my app is running then this "ProfilePicture" object is successfully uploaded and all is well - the database object has its own internal workings with data structures/caches and what not. All callbacks that may exist are maintained and the app state is straightforward. But I'm not clear what happens if the app "dies" at some point during the upload. It seems that any callbacks/notifications are dead. According to the API documentation- the uploading is handled by a separate process. Therefor the upload will continue and my app will be awakened at some point in the future to handle completion. But the object "aNewProfilePicture" is non existant at that point and all callbacks/objects are gone. I don't understand what context exists at this point. How am I supposed to ensure consistency in my DB and UI (For instance update the "successfullyUploaded" property for that user)? Do I need to re-work everything touching the DB or UI to correspond with the new API and work in a context free environment?

    Read the article

  • Creating dynamic resource in cookbook

    - by zsong
    Long story short, here is my code: template "...." do .... notifies :restart,"service[myservice_One]" notifies :restart,"service[myservice_Two]" end ['One', 'Two'].each do |proj| service 'myservice_#{proj}' do start_command "setsid /etc/init.d/my_command #{proj} start" stop_command "setsid /etc/init.d/my_command #{proj} stop" restart_command "setsid /etc/init.d/my_command #{proj} restart" status_command "setsid /etc/init.d/my_command #{proj} status" supports :status => true, :restart => true action [:enable,:start] end end I got this error: template[...] is configured to notify resource service[celery_worker_One] with action restart, but service[celery_worker_One] cannot be found in the resource collection. I know I can duplicate my code to make it work but how to dynamically create the services? Thanks!

    Read the article

  • How to build AndEngine in Android Studio?

    - by marcu
    I wanted to build AndEngine and andEnginePhysicsBox2DExtension from Anchor Center branch, but build failed. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':andEngine:compileReleaseNdk'. > com.android.ide.common.internal.LoggedErrorException: Failed to run command: /home/mariusz/android/android-ndk/ndk-build NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/mariusz/Downloads/AndEngineApp/andEngine/build/intermediates/ndk/release/Android.mk APP_PLATFORM=android-17 NDK_OUT=/home/mariusz/Downloads/AndEngineApp/andEngine/build/intermediates/ndk/release/obj NDK_LIBS_OUT=/home/mariusz/Downloads/AndEngineApp/andEngine/build/intermediates/ndk/release/lib APP_ABI=all Error Code: 2 Output: /home/mariusz/android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/mariusz/Downloads/AndEngineApp/andEngine/build/intermediates/ndk/release/obj/local/armeabi-v7a/objs/andengine_shared//home/mariusz/Downloads/AndEngineApp/andEngine/src/main/jni/src/GLES20Fix.o: in function Java_org_andengine_opengl_GLES20Fix_glVertexAttribPointer:/home/mariusz/Downloads/AndEngineApp/andEngine/src/main/jni/src/GLES20Fix.c:9: error: undefined reference to 'glVertexAttribPointer' /home/mariusz/android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/mariusz/Downloads/AndEngineApp/andEngine/build/intermediates/ndk/release/obj/local/armeabi-v7a/objs/andengine_shared//home/mariusz/Downloads/AndEngineApp/andEngine/src/main/jni/src/GLES20Fix.o: in function Java_org_andengine_opengl_GLES20Fix_glDrawElements:/home/mariusz/Downloads/AndEngineApp/andEngine/src/main/jni/src/GLES20Fix.c:13: error: undefined reference to 'glDrawElements' collect2: ld returned 1 exit status make: *** [/home/mariusz/Downloads/AndEngineApp/andEngine/build/intermediates/ndk/release/obj/local/armeabi-v7a/libandengine_shared.so] Error 1 I'm using Android Studio version 0.86.

    Read the article

  • Version control for subtitle creation

    - by user3635
    We make subtitles for a TV series and I plan to use a VCS for it. The structure of project directory is like this: series/ episode1/nameofepisode1.str episode2/nameofepisode2.str episode3/nameofepisode3.str ... Question: When I finish subtitle of an episode, I want to assign release tag for this episode (episode1_v1). I wanted to use git for this, but in git tag is assigned only to the whole repository. What to do, so that I can view every episode progress separately? Maybe there are some more suitable VCS for this?

    Read the article

  • How can I remove a duplicate object from a MongoDB array?

    - by andrewrk
    My data looks like this: foo_list: [ { id: '98aa4987-d812-4aba-ac20-92d1079f87b2', name: 'Foo 1', slug: 'foo-1' }, { id: '98aa4987-d812-4aba-ac20-92d1079f87b2', name: 'Foo 1', slug: 'foo-1' } { id: '157569ec-abab-4bfb-b732-55e9c8f4a57d', name: 'Foo 3', slug: 'foo-3' } ] Where foo_list is a field in a model called Bar. Notice that the first and second objects in the array are complete duplicates. Aside from the obvious solution of switching to PostgresSQL, what MongoDB query can I run to remove duplicate entries from foo_list? Similar answers that do not quite cut it: http://stackoverflow.com/a/16907596/432 http://stackoverflow.com/a/18804460/432 These questions answer the question if the array had bare strings in it. However in my situation the array is filled with objects. I hope it is clear that I am not interested in a query; I want the duplicates to be gone from the database forever.

    Read the article

  • Grep without storing search to the "/ register in Vim

    - by Phro
    In my .vimrc I have a mapping that makes a line of text 'title capitalized': noremap <Leader>at :s/\v<(.)(\w{2,})/\u\1\L\2/g<CR> However, whenever I run this function, it highlights every word that is at least three characters long in my entire document. Of course I could get this behaviour to stop simply by appending :nohlsearch<CR> to the end of the mapping, but this is more of an awkward hack that still avoids a bigger problem: The last search has been replaced by \v<(.)(\w{2,}). Is there any way to use the search commands in Vim without storing the last search in the "/ register; a 'silent' search of sorts? That way, after running this title-making command, I can still use my previous search to navigate the document using n, N, etc. Edit Using @brettanomyces' answer, I found that simply setting the mapping: noremap <Leader>at :call setline(line('.'),substitute(getline('.'), '\v<(.)(\w{2,})', '\u\1\L\2', 'g'))<CR> will successfully perform the substitution without storing the searched text into the / register.

    Read the article

  • Converting Python Script to Vb.NET - Involves Post and Input XML String

    - by Jason Shoulders
    I'm trying to convert a Python Script to Vb.Net. The Python Script appears to accept some XML input data and then takes it to a web URL and does a "POST". I tried some VB.NET code to do it, but I think my approach is off because I got an error back "BadXmlDataErr" plus I can't really format my input XML very well - I'm only doing string and value. The input XML is richer than that. Here is an example of what the XML input data looks like in the Python script: <obj is="MyOrg:realCommand_v1/" > <int name="priority" val="1" /> <real name="value" val="9.5" /> <str name="user" val="MyUserName" /> <reltime name="overrideTime" val="PT60S"/> </obj> Here's the Vb.net code I attempted to convert that: Dim reqparm As New Specialized.NameValueCollection reqparm.Add("priority", "1") reqparm.Add("value", "9.5") reqparm.Add("user", "MyUserName") reqparm.Add("overrideTime", "PT60S") Using client As New Net.WebClient Dim sTheUrl As String = "[My URL]" Dim responsebytes = client.UploadValues(sTheUrl, "POST", MyReqparm) Dim responsebody = (New System.Text.UTF8Encoding).GetString(responsebytes) End Using I feel like I should be doing something else. Can anyone point me to the right direction?

    Read the article

  • Async task ASP.net HttpContext.Current.Items is empty - How do handle this?

    - by GuruC
    We are running a very large web application in asp.net MVC .NET 4.0. Recently we had an audit done and the performance team says that there were a lot of null reference exceptions. So I started investigating it from the dumps and event viewer. My understanding was as follows: We are using Asyn Tasks in our controllers. We rely on HttpContext.Current.Items hashtable to store a lot of Application level values. Task<Articles>.Factory.StartNew(() => { System.Web.HttpContext.Current = ControllerContext.HttpContext.ApplicationInstance.Context; var service = new ArticlesService(page); return service.GetArticles(); }).ContinueWith(t => SetResult(t, "articles")); So we are copying the context object onto the new thread that is spawned from Task factory. This context.Items is used again in the thread wherever necessary. Say for ex: public class SomeClass { internal static int StreamID { get { if (HttpContext.Current != null) { return (int)HttpContext.Current.Items["StreamID"]; } else { return DEFAULT_STREAM_ID; } } } This runs fine as long as number of parallel requests are optimal. My questions are as follows: 1. When the load is more and there are too many parallel requests, I notice that HttpContext.Current.Items is empty. I am not able to figure out a reason for this and this causes all the null reference exceptions. 2. How do we make sure it is not null ? Any workaround if present ? NOTE: I read through in StackOverflow and people have questions like HttpContext.Current is null - but in my case it is not null and its empty. I was reading one more article where the author says that sometimes request object is terminated and it may cause problems since dispose is already called on objects. I am doing a copy of Context object - its just a shallow copy and not a deep copy.

    Read the article

  • About the new Microsoft Innovation Center (MIC) in Miami

    - by Herve Roggero
    Originally posted on: http://geekswithblogs.net/hroggero/archive/2014/08/21/about-the-new-microsoft-innovation-center-mic-in-miami.aspxLast night I attended a meeting at the new MIC in Miami, run by Blain Barton (@blainbar), Sr IT Pro Evangelist at Microsoft. The meeting was well attended and is meant to be run as a user group format in a casual setting. Many of the local Microsoft MVPs and group leaders were in attendance as well, which allows technical folks to connect with community leaders in the area. If you live in South Florida, I highly recommend to look out for future meetings at the MIC; most meetings will be about the Microsoft Azure platform, either IT Pro or Dev topics. For more information on the MIC, check out this announcement:  http://www.microsoft.com/en-us/news/press/2014/may14/05-02miamiinnovationpr.aspx. About Herve Roggero Herve Roggero, Microsoft Azure MVP, @hroggero, is the founder of Blue Syntax Consulting (http://www.bluesyntaxconsulting.com). Herve's experience includes software development, architecture, database administration and senior management with both global corporations and startup companies. Herve holds multiple certifications, including an MCDBA, MCSE, MCSD. He also holds a Master's degree in Business Administration from Indiana University. Herve is the co-author of "PRO SQL Azure" and “PRO SQL Server 2012 Practices” from Apress, a PluralSight author, and runs the Azure Florida Association.

    Read the article

  • Create VPN between windows and sonic wall

    - by Chris Lively
    I'm trying to establish a VPN connection between our Windows 2008 R2 server and a client's SonicWall device. The problem is, I'm not entirely sure where to start. I thought I could just add it to RRAS but this doesn't appear to work (times out), I'm not entirely sure I did that right anyway. My server is hosted on an EC2 instance if that matters. My question then is how should I go about establishing this type of connection?

    Read the article

  • Random Windows application crashes on Windows Server Hyper-V Core 2012

    - by Marlamin
    We're having some issues with our Hyper-V Core 2012 R2 installation on a HP DL360G8. We have an identical server with Hyper-V Core 2012 (not R2) that does not have these issues. When logging off from the physical server/via remote desktop, we sometimes get this error: Configure-SMRemoting.exe - Application Error : The application was unable to start correctly (0xc0000142). Click OK to close the application. We've also once or twice seen a "memory could not be read" error mentioning LoginUI.exe (another Windows app in System32) but have been unable to get an exact description. It's rather worrying to get such errors on a fresh install of Hyper-V 2012 R2. Is this even anything to worry about? Things we've done: Memtest86+, no memory errors Checksummed the file that is crashing with the one in the verified correct ISO, files match Server firmware upgrade to latest firmware of all present hardware, no visible changes Remade the RAID5 array , no change Reinstalled a few times, no change Reinstall without applying Windows updates after, no change

    Read the article

  • Joining an Ubuntu 14.04 machine to active directory with realm and sssd

    - by tubaguy50035
    I've tried following this guide to set up realmd and sssd with active directory: http://funwithlinux.net/2014/04/join-ubuntu-14-04-to-active-directory-domain-using-realmd/ When I run the command realm –verbose join domain.company.com –user-principal=c-u14-dev1/[email protected] –unattended everything seems to connect. My sssd.conf looks like the following: [nss] filter_groups = root filter_users = root reconnection_retries = 3 [pam] reconnection_retries = 3 [sssd] domains = DOMAIN.COMPANY.COM config_file_version = 2 services = nss, pam [domain/DOMAIN.COMPANY.COM] ad_domain = DOMAIN.COMPANY.COM krb5_realm = DOMAIN.COMPANY.COM realmd_tags = manages-system joined-with-adcli cache_credentials = True id_provider = ad krb5_store_password_if_offline = True default_shell = /bin/bash ldap_id_mapping = True use_fully_qualified_names = True fallback_homedir = /home/%d/%u access_provider = ad My /etc/pam.d/common-auth looks like this: auth [success=3 default=ignore] pam_krb5.so minimum_uid=1000 auth [success=2 default=ignore] pam_unix.so nullok_secure try_first_pass auth [success=1 default=ignore] pam_sss.so use_first_pass # here's the fallback if no module succeeds auth requisite pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around auth required pam_permit.so # and here are more per-package modules (the "Additional" block) auth optional pam_cap.so However, when I try to SSH into the machine with my active directory user, I see the following in auth.log: Aug 21 10:35:59 c-u14-dev1 sshd[11285]: Invalid user nwalke from myip Aug 21 10:35:59 c-u14-dev1 sshd[11285]: input_userauth_request: invalid user nwalke [preauth] Aug 21 10:36:10 c-u14-dev1 sshd[11285]: pam_krb5(sshd:auth): authentication failure; logname=nwalke uid=0 euid=0 tty=ssh ruser= rhost=myiphostname Aug 21 10:36:10 c-u14-dev1 sshd[11285]: pam_unix(sshd:auth): check pass; user unknown Aug 21 10:36:10 c-u14-dev1 sshd[11285]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=myiphostname Aug 21 10:36:10 c-u14-dev1 sshd[11285]: pam_sss(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=myiphostname user=nwalke Aug 21 10:36:10 c-u14-dev1 sshd[11285]: pam_sss(sshd:auth): received for user nwalke: 10 (User not known to the underlying authentication module) Aug 21 10:36:12 c-u14-dev1 sshd[11285]: Failed password for invalid user nwalke from myip port 34455 ssh2 What do I need to do to allow active directory users the ability to log in?

    Read the article

  • RHEL 6.5 and LDAP

    - by zuboje
    I am trying to connect our Active directory server to brand new RHEL 6.5 server. I want to authenticate users using AD credentials, but I want to restrict that only certain users can login, I don't want to allow anybody from AD to connect to it. I would like to use something like this: CN=linuxtest,OU=SecurityGroups,DC=mydomain,DC=local but I am not sure how would I setup OU and CN. I use sssd for authentication and my id_provider = ad. I wanted to use id_provider = ldap, but that did not work at all and RHEL customer service told me to setup this way. But I want to have a little bit more control who can do what. I know I can use this to restrict simple_allow_users = user1, user2, but I have 400+ users, I really don't want to go and type them all. Question is how would I setup OU or CN for my search?

    Read the article

  • VM load and ping problems after replacing server motherboard

    - by Andre
    Recently, we had to replace the motherboard of one of our servers. The procedure was done by IBM as it had guarantee. The server runs ESXi 5.1, with several virtual machines, including our main mail server (Domino) and a file server. After the replacing the motherboard and staring the VMs, ESXi asked us if we had moved it or copied (different motherboard is like a different computer). We clicked the latter. We started each machine and after some basic reconfiguration, all of them were up. However, we have been having problems with the mail server, it has been acting really slow at times (this could be when it syncs with the secondary mail server) and we have been checking with Centreon (a Nagios frontend) that its CPU load has been a bit high at times and ping response too. There was a moment this morning in which I tried connecting via SSH console and it was really slow to show login and basic commands like ifconfig and top. This particular mail server is a CentOS 4.4.7 64-bit. The little configuring we had to do after restarting it was to configure the network connection as it was resolving through DHCP. Our mail software is Lotus Notes server 9. Do you know of any way in which this replacement may be causing these difficulties, and how to fix it? Thanks.

    Read the article

  • 503 jrun servlet error

    - by tonedigital
    I'm having issues with my ColdFusion 9 server, it continuously keeps crashing. When I go to a web page from my application I am getting a "503 Jrun Servlet Error". Does anyone have any clue to why this is happening? It appears that my memory is being consumed greatly and causing my server to crash. I read somewhere about setting this setting to false "cfset This.Clientmanagement="false"". Any ideas about any of this? All suggestions would be a tremendous help. Thanks much. tone

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >