Recent Questions - bighow RSS most recent 50 added to bighow.org http://bighow.org/rss/ 42363878 What is the difference between JEE and J2EE? http://bighow.org/42363878-What_is_the_difference_between_JEE_and_J2EE_.html p I want to learn about the difference between JEE and J2EE I guess both are Java Enterprise development tools or environments But what makes them exactly different and similar p 42363877 How to get wikipedia page from wikidata Qid http://bighow.org/42363877-How_to_get_wikipedia_page_from_wikidata_Qid.html p I think that the title says it all how to get the wikipedia page in a particular language say french from the Wikidata Qid example Q19675 The question seems obvious but strangely I find nothing on the web I m looking for a url command that I could use with requests python module something like p pre code url https www wikidata org w api php action some method amp ids Q19675 r requests post url headers User Agent Magic Browser code pre p Someone can help me p 42363876 Change the margin of first visible item in recyclerview http://bighow.org/42363876-Change_the_margin_of_first_visible_item_in_recyclerview.html p How to change the margin bottom with 20 dp of first complete visible item on horizontal recycleview with cards I can get only the index of first complete visible item but not any reference to the view p p mRecyclerView setOnScrollListener new RecyclerView OnScrollListener Override public void onScrolled RecyclerView recyclerView int dx int dy super onScrolled recyclerView dx dy p pre code firstVisibleItem lm findFirstCompletelyVisibleItemPosition View view mRecyclerView getChildAt firstVisibleItem RelativeLayout LayoutParams lp new RelativeLayout LayoutParams 300 150 lp setMargins 0 0 0 20 view setLayoutParams lp code pre 42363875 Ruby on rails Spree and S3 http://bighow.org/42363875-Ruby_on_rails_Spree_and_S3.html p I am having a difficult time connecting Amazon S3 buckets to a e commerce spree application I have added the necessary code to the initializer spree rb and set the necessary environment variables This is the code inside my spree rb p pre code Configure Solidus Preferences See http docs solidus io Spree AppConfiguration html for details Spree config do config Without this preferences are loaded and persisted to the database This changes them to be stored in memory This will be the default in a future version config use static preferences Core Default currency for new sites config currency USD from address for transactional emails config mails from expressmobiletechs gmail com Uncomment to stop tracking inventory levels in the application config track inventory levels false When set product caches are only invalidated when they fall below or rise above the inventory cache threshold that is set Default is to invalidate cache on any inventory changes config inventory cache threshold 3 Frontend config logo logo jpg config admin interface logo logo jpg Template to use when rendering layout config layout spree layouts spree application Admin Custom logo for the admin config admin interface logo logo solidus logo png Gateway credentials can be configured statically here and referenced from the admin They can also be fully configured from the admin config static model preferences add Spree Gateway StripeGateway stripe env credentials secret key ENV STRIPE SECRET KEY publishable key ENV STRIPE PUBLISHABLE KEY server Rails env production production test test mode Rails env production end Spree Frontend Config configure do config config use static preferences config locale en end Spree Backend Config configure do config config use static preferences config locale en end Spree Api Config configure do config config use static preferences config requires authentication true end Spree user class Spree LegacyUser attachment config s3 credentials access key id ENV AWS ACCESS KEY ID secret access key ENV AWS SECRET ACCESS KEY bucket ENV S3 BUCKET NAME storage s3 s3 headers Cache Control gt max age 31557600 s3 protocol https bucket ENV S3 BUCKET NAME url s3 domain url styles mini 48x48 gt small 100x100 gt product 240x240 gt large 600x600 gt path spree class id style basename extension default url spree class id style basename extension default style product attachment config each do key value Spree Image attachment definitions attachment key to sym value end code pre p a href http i stack imgur com rhCqC jpg rel nofollow img src http i stack imgur com rhCqC jpg alt enter image description here a p p I am trying to get my spree stores image uploading for products to work with s3 No other discussion on stack has been able to help me p 42363874 I have a table named dmp with 4 columns, I want to query selected data from a column call by parent id http://bighow.org/42363874-I_have_a_table_named_dmp_with_4_columns__I_want_to_query_selected_data_from_a_column_call_by_parent_id.html p a href http i stack imgur com ZlDxH png rel nofollow img src http i stack imgur com ZlDxH png alt table a p p I have a table named dmp with 4 columns id name dtype and parent I want to query specific data from a column call by parent id p p I want to display parent name nill in parent column when choose division from dtype column and also want to display all parent name like Ramna Dhanmondi when choose thana from dtype column how it possible p 42363873 Is there any library to implement send and receive call from asterisk event? http://bighow.org/42363873-Is_there_any_library_to_implement_send_and_receive_call_from_asterisk_event_.html p I want to design a CRM and in a project where i need to connect Asterisk IP PBX but I don t know how to do it In my scenario every user have a extension and when click on number dial number from Asterisk IP PBX When he receive a call tg call from this extension see a pop up and caller ID p p Is there any library to implement send and receive call from asterisk event p 42363872 Setup Simple Injector with ASP.NET Identity 2.2.1 http://bighow.org/42363872-Setup_Simple_Injector_with_ASP_NET_Identity_2_2_1.html p So I ve been trying to setup ASP NET Identity 2 2 1 and I keep hitting roadblocks For being something that is supposed to be auto generated by the framework it sure seems complicated to configure I think I m almost there but I m still having issues setting up IoC with Simple Injector p p I ve been reading through other StackOverflow questions and blogs about these issues Most of them seem out of date because they deal with ASP NET Identity 1 0 Or they deal with other IoC frameworks and I just can t translate them to Simple Injector I ve used other IoC Frameworks but I m new to Simple Injector p p 1 I ve placed all of the configuration code for ApplicationUserManager in it s constructor instead of in it s Create method p p strong ApplicationUserManager strong p pre code public class ApplicationUserManager UserManager lt ApplicationUser gt public ApplicationUserManager IUserStore lt ApplicationUser gt store IdentityFactoryOptions lt ApplicationUserManager gt options base store Configure validation logic for usernames UserValidator new UserValidator lt ApplicationUser gt this AllowOnlyAlphanumericUserNames false RequireUniqueEmail true Configure validation logic for passwords PasswordValidator new PasswordValidator RequiredLength 8 RequireNonLetterOrDigit true RequireDigit true RequireLowercase true RequireUppercase true var dataProtectionProvider options DataProtectionProvider if dataProtectionProvider null UserTokenProvider new DataProtectorTokenProvider lt ApplicationUser gt dataProtectionProvider Create ASP NET Identity code pre p 2 I ve created a custom implementation of UserStore with nothing in it for the time being p p strong ApplicationUserStore strong p pre code public class ApplicationUserStore UserStore lt ApplicationUser gt public ApplicationUserStore ApplicationDbContext context base context code pre p 3 I ve commented out both of the app CreatePerOwinContext lines in Startup Auth cs p p 4 In AccountController I removed the empty constructor the UserManager class and Dispose method I changed the Constructor to the follow p p strong AccountController strong p pre code public ISecureDataFormat lt AuthenticationTicket gt AccessTokenFormat get private set private ApplicationUserManager applicationUserManager public AccountController ApplicationUserManager applicationUserManager ISecureDataFormat lt AuthenticationTicket gt accessTokenFormat applicationUserManager applicationUserManager AccessTokenFormat accessTokenFormat code pre p 5 So finally setting up Simple Injector IoC p p strong Simple Injector strong p pre code var container new Container container RegisterPerWebRequest lt ApplicationDbContext gt container RegisterPerWebRequest lt IUserStore lt ApplicationUser gt ApplicationUserStore gt container RegisterPerWebRequest lt ApplicationUserManager gt container Verify container Register lt IAuthenticationManager gt gt HttpContext Current GetOwinContext Authentication code pre p So the biggest problem is that with this setup I get an error about ApplicationUserManager p blockquote p Additional information The configuration is invalid The following diagnostic warnings were reported Lifestyle Mismatch ApplicationUserManager Web Request depends on IdentityFactoryOptions Transient p blockquote p Also I know that the HttpContext will cause issues since it s not setup at this point I ll have to setup some type of factory pattern for it p p So I m looking for any kind of help on fixing this error how to setup the factory advice if I m breaking any kind of design patterns best practices if I should even be using ASP NET Identity should I try the version of Identity in ASP NET Core 1 0 etc Feel free to tear this apart because I m really struggling to figure this out p p Thanks p 42363871 How to group cells together in columns, in PHP http://bighow.org/42363871-How_to_group_cells_together_in_columns__in_PHP.html p I have written code in PHP listed below but face a small problem p pre code lt html gt lt head gt lt title gt trans lt title gt lt body gt lt style gt table th td border 1px solid black width 700px margin auto lt style gt lt php con mysqli connect localhost root if con die not ok mysqli select db con uoh q1 SELECT FROM student record INNER JOIN degree plan ON student record course number degree plan course number INNER JOIN courses ON student record course number courses course number where student record id 201102887 AND degree plan major COE result mysqli query con q1 if result echo lt table gt echo lt tr gt echo lt th gt courses lt th gt echo lt th gt terms lt th gt echo lt th gt grades lt th gt echo lt th gt CRD lt th gt echo lt tr gt while row mysqli fetch array result echo lt tr gt echo lt td gt row code lt td gt echo lt td gt row term no lt td gt echo lt td gt row grade lt td gt echo lt tr gt echo lt table gt gt lt body gt lt html gt code pre p When I run the code I see the following output p pre code courses terms grades CHEM 101 1 A ENGL 101 1 C PE 101 1 B PHYS 101 1 F ENGL 102 2 B PE 101 2 B PHYS 102 2 D MATH 201 3 A COE 200 3 B code pre p But I do not want it like that I want the term cells to become one like this p pre code courses term grade CHEM 101 1 A ENGL 101 C PE 101 B PHYS 101 F ENGL 102 2 B PE 101 B PHYS 102 D MATH 201 3 A COE 200 B code pre p or in any other way that does not let term repeat by which I mean group the courses that have the same term together p 42363870 Cordova Error Error: Error code 1 for command: cmd with args: /s,/c, http://bighow.org/42363870-Cordova_Error_Error__Error_code_1_for_command__cmd_with_args___s__c_.html p when I write this command in cmd cordova build android this error happens p p FAILURE Build failed with an exception Where p pre code Script H prjPathprjNameplatformsandroidCordovaLibcord code pre p ova gradle line 64 What went wrong A problem occurred evaluating root project android p pre code gt No installed build tools found Please install the Android build tools version 1 9 1 0 or higher code pre p Try p pre code Run with stacktrace option to get the stack trace Run with info or debug code pre p option to get more log output p pre code BUILD FAILED Error Error code 1 for command cmd with args s c H prjPathprjNameplatformsandroidgradlew cdvBuildDebug b H prjPathprjNameplatformsandroid uild gradle Dorg gradle daemon true Pan droid useDeprecatedNdk true code pre p what should I do and this is my SDK manager a href http i stack imgur com 6ezWb png rel nofollow img src http i stack imgur com 6ezWb png alt SDK Manager a p 42363869 Distributing ReactJS components written in ES6 and usnig them inside ES5 source code http://bighow.org/42363869-Distributing_ReactJS_components_written_in_ES6_and_usnig_them_inside_ES5_source_code.html p I have done a ReactJS component with a Redux store binding two together using react redux p p i have written this code using ES6 and webpack when i run the component individually and test it inside the code it self by an ES6 import the code is working fine p p But i want to distribute the component as a reusable html element to be used in other projects in our organization so i got the webpack build and used it inside a angularjs project by binding the component using a angular directive but then i face many problems the component is not working as expected p p i have posted a seperate post about the problem here a href http stackoverflow com questions 37050805 error using component done with react redux and react redux and build with webpa stack overflow question a p p what i wanted to know is the methodology of distributing a reusable react component written using ES6 and bundled webpack or other bundling mechanism and using the component inside an ES5 source code please help with me some resources guides or some pointers if possible p 42363867 Converting Date to string with DateTimePicker http://bighow.org/42363867-Converting_Date_to_string_with_DateTimePicker.html pre code Dim sql As String SELECT FROM old where inputdate BETWEEN DateTimePicker2 Value ToShortDateString AND DateTimePicker3 Value ToShortDateString Dim dataadapter As New SqlDataAdapter sql connection Dim ds As New DataSet connection Open dataadapter Fill ds old table connection Close code pre p I have 2 DateTimePickers of format Short In SQL the column name inputdate of DataType date When I choose dates with days lt 12 everything is working fine When I choose dates with days 12 I am having this error I can see it s a matter of day and month but i m still can t get the solution Any help is really appreciated Conversion failed when converting date and or time from character string p 42363866 How to access a file in a dynamic web project in eclipse using relative path? http://bighow.org/42363866-How_to_access_a_file_in_a_dynamic_web_project_in_eclipse_using_relative_path_.html p I have a dynamic web project in eclipse I have created a configuration folder that you can seen in the image Inside that folder exists a file named config properties Now I want to access this file using code FileInputStream code but i am unable to read it by using relative path I am reading this file from a class which is inside the Java Resources folder src package Please help me to get the relative path of this properties file Additionally if you could tell how this relative path works in this kind of projects that would be great p p a href http i stack imgur com U9POA png rel nofollow img src http i stack imgur com U9POA png alt enter image description here a p 42363865 Writing List to a csv file in Python http://bighow.org/42363865-Writing_List_to_a_csv_file_in_Python.html p I m currently using Python v2 10 I m having trouble writing data to a csv file Wondering if someone might be able to tell me what I am doing wrong I m getting a error message that says TypeError list indices must be integers not tuple not sure how to correct this Also I thought to write to a csv file the data must be in string format p p Ideally I would like each row to be like Name X1 Y1 X2 Y2 X3 Y3 p p Here is the code I have p pre code import csv def main my coords open Geo Coords csv a coords csv reader my coords how many raw input How many Geometries do you wish to enter counter 0 coords while counter lt how many geometry raw input Geometry Name first coordE raw input 1st Co ord Easting first coordN raw input 1st Co ord Northing sec coordE raw input 2nd Co ord Easting sec coordN raw input 2nd Co ord Northing third coordE raw input 3rd Co ord Easting third coordN raw input 3rd Co ord Northing counter counter 1 my coords write coords geometry first coordE first coordN sec coordE sec coordN third coordE third coordN my coords close print my coords main code pre 42363864 Python: manipulating lists http://bighow.org/42363864-Python__manipulating_lists.html p strong problem strong p p I have to get elements from a text file to a list diagonally and from top to buttom Any help would be appreciated the file would look like this p p strong em text file letters txt thought it would be hard i removed Y and Z from my first post em strong p pre code A B C D E F G H I J K L M N O P Q R S T U V W X code pre p strong the lists should look like this strong p pre code topButtom List AGMS BHNT CIOU DJPV EKQW FLRX bLeftToURight A GB MHC SNID TOJE UPKF VQL WR X code pre p strong my current code for top to buttom strong p pre code top to buttom topButtom List should be AGMS BHNT CIOU DJPV EKQW FLRX openFile open letters txt for i in openFile i i replace length len i openFile close openFile open letters txt counter 0 for eachIterration in range length for line in openFile line line replace counter should be added by 1 each time inner loop itterates x4 and outter loop x1 topButtom List append line counter counter counter 1 openFile close code pre p strong em What I was trying to do with the code above em strong p p I was trying to get the top to buttom characters from the text file and get it in a list called code topButtom List code I used counter to define the index that for every itteration the outer loop does the index would be added by 1 The way I see it is the outerloop will start the inner loop will itterate x4 adding code AGMS code in the code topButtom List code on the first itteration the outer loop will itterate again and add 1 to counter code BHNTZ code will be added on the second itteration and so on the outer loop will itterate again and add 1 to counter p p from the text file letters txt I want to populate code topButtom List code p p strong em output I am getting em strong p pre code A G M S code pre p strong em expected output em strong p pre code AGMS BHNT CIOU DJPV EKQW FLRX code pre 42363863 How to deal with precision in Matlab calculations http://bighow.org/42363863-How_to_deal_with_precision_in_Matlab_calculations.html p I m trying to calculate the intersection points between a circle and a square in Matlab I succesfully calculated one of the intersection points or that is seemed at first but when I zoom into my plot I noticed that the closer I zoom in the greater mistake I have click the image to see it better p p a href http i stack imgur com dmGjP png rel nofollow img src http i stack imgur com dmGjP png alt enter image description here a p p As you can see from the image the closer I zoom the farther away the intersection points moves My question is Is this error inevitable or is there a way to solve this Is this simply a precision error or could this be a mistake in my code p p P S The following code is the essential part where I calculate the intersection point in the image above It simply takes the Y value known at the upper border of the square and then calculates the X value using the equation of a circle p pre code knownY uY c r 2 cX 2 cY 2 knownY 2 2 cY knownY if 4 cX 2 4 c gt 0 real solution exists solve result x1 2 cX sqrt 4 cX 2 4 c 2 x2 2 cX sqrt 4 cX 2 4 c 2 if bX lt x1 amp amp x1 lt uX intersection intPoints intPoints x1 knownY end if bX lt x2 amp amp x2 lt uX intersection intPoints intPoints x2 knownY end end code pre p Thank you p p UPDATE p p I found the mistake already No need to answer I had my calculations perfectly fine It was the plotting of the circle that was wrong Here was the code for my circle plot p pre code t linspace 0 2 pi plot v 1 r cos t v 2 r sin t color color code pre p the code linspace code creates 100 points around the circle When I did the following instead p pre code t linspace 0 2 pi 1000000 plot v 1 r cos t v 2 r sin t color color code pre p I got much more exact plot p 42363862 ListView - > Displaying data through coding http://bighow.org/42363862-ListView_____Displaying_data_through_coding.html p I want to retrieve the recipe names from the database and need to display the data in the list form I have added the code behind But what do I include in the template p p Source p pre code lt asp ListView ID ListView1 runat server gt lt ItemTemplate gt lt ItemTemplate gt lt asp ListView gt code pre p Code behind p pre code protected void Page Load object sender EventArgs e MySqlConnection con new MySqlConnection Server localhost Database FreedomKitchen Uid root Password con Open MySqlCommand cmd new MySqlCommand select Recipe Name from Recipes con MySqlDataAdapter da new MySqlDataAdapter da SelectCommand cmd DataSet ds new DataSet da Fill ds Recipe Names ListView1 DataSource ds ListView1 DataBind code pre 42363861 How to make image center horizontally in android http://bighow.org/42363861-How_to_make_image_center_horizontally_in_android.html p This is layout file p pre code lt xml version 1 0 encoding utf 8 gt lt android support v7 widget CardView xmlns android http schemas android com apk res android android id id card view android layout width match parent android layout height wrap content android layout margin 8dp gt lt RelativeLayout android layout width wrap content android layout height wrap content android padding 8dp gt lt ImageView android id id thumbnail android layout width 300dp android layout height 200dp android adjustViewBounds true android layout centerHorizontal true android scaleType fitXY gt lt TextView android layout width wrap content android layout height wrap content android id id title android layout below id thumbnail android textSize 24sp gt lt TextView android layout width wrap content android layout height wrap content android id id offer android layout below id title gt lt RelativeLayout gt lt android support v7 widget CardView gt code pre p even though i have mentioned android layout centerHorizontal true But still image is not centered p p How to make image horizontally centered p 42363859 getting post value from form created in loop in codeigniter http://bighow.org/42363859-getting_post_value_from_form_created_in_loop_in_codeigniter.html p I need post values from form created in loop Here is my view p pre code lt php echo form open test id gt for i 0 i lt count array value i lt input type text name name value lt php echo array value i gt gt lt input type submit gt lt php echo form close gt code pre p My controller p pre code function test id echo this gt input gt post name code pre p This returns array of values but i need the value from the id that is submitted p 42363858 how to find big file and delete on linux system http://bighow.org/42363858-how_to_find_big_file_and_delete_on_linux_system.html p When I install something in my linux system strong CentOS release 6 5 Final strong It happens p p Error Downloading Packages ncdu 1 7 1 el6 x86 64 Insufficient space in download directory var cache yum epel packages p p And I use em df em command it shows p pre code df h Filesystem Size Used Avail Use Mounted on dev sda2 77G 73G 0 100 tmpfs 7 8G 0 7 8G 0 dev shm dev sda1 239M 43M 183M 19 boot code pre p sda2 was mounted on but when I go to the root and use command em du em p pre code du sh 6 2M bin 41M boot 176K dev 26M etc 488K export 6 7G home 268M lib 19M lib64 16K lost found 4 0K media 4 0K mnt 56M opt du cannot access proc 1531 task 1531 fd 4 No such file or directory du cannot access proc 1531 task 1531 fdinfo 4 No such file or directory du cannot access proc 1531 fd 4 No such file or directory du cannot access proc 1531 fdinfo 4 No such file or directory du cannot access proc 6873 task 7037 fd 125 No such file or directory 0 proc 640K root 9 0M sbin 4 0K selinux 4 0K srv 0 sys 569M tmp 1 4G usr 261M var 4 0K zookeeper server pid code pre p where is my 77G gone how do I find my big file and delete p 42363857 Invalid provider - only instances of Provider and Type are allowed, got: [object Object] http://bighow.org/42363857-Invalid_provider___only_instances_of_Provider_and_Type_are_allowed__got___object_Object_.html p I m writing an angular2 meteor application using typescript but i guess this error does not relate to angular at all just to meteor and mongodb p p i created a collections directory that will loaded both in the server and in the client it contains the following typescript file measurment types colelction ts p pre code import Mongo from meteor mongo export interface MeasurementTypesInterface name string namePlural string export var MeasurementTypesCollection new Mongo Collection lt MeasurementTypesInterface gt measurement types code pre p it compiles fine on the server side but on the client side in the browser I have the following error p pre code Invalid provider only instances of Provider and Type are allowed got object Object code pre p the trace is going back to the following line of code p pre code export var MeasurementTypesCollection new Mongo Collection lt MeasurementTypesInterface gt measurement types code pre p am I missing something do I need to define it differently on the client side p 42363856 Checking a file for its MD5 hash possible? C# .NET http://bighow.org/42363856-Checking_a_file_for_its_MD5_hash_possible__C___NET.html p I was looking over a tutorial about anti viruses and malware and stuff like that and that subject is something that caught my interest alot Unfortunatly the software he did was written in VB p p So I am trying to develop something simple to get my feet wet in this area p p The thought is that I browse for a file its simple just use the OpenFileDialog p p then I select it and the code checks for a certain hash to see if its malicious or not p p based upon a list or something of a bunch of hashes that I already collected from somewhere p p To me the thought seems really simple not sure if this is even possible If it is would you mind providing me with some examples or show me someone who has done this before and would have some examples ready for me to read from p 42363855 Hibernate Mapping Class to Itself http://bighow.org/42363855-Hibernate_Mapping_Class_to_Itself.html p I Want to Map Class in Hibernate with Key to The table itself by Hibernate not let it happen p pre code Entity public class someclass Id GeneratedValue strategy GenerationType IDENTITY protected int id ManyToOne protected someclass parent private Double value code pre p My xml file p pre code lt property name hibernate hbm2ddl auto gt create lt property gt code pre p p p And error p pre code Unable to execute command alter table someclass drop foreign key FKjyit8vtv8upkxd7wgt4wtoj0g Caused by com mysql jdbc exceptions jdbc4 MySQLSyntaxErrorException Table someclass someclass doesn t exist code pre p How to Map it Correctly p 42363854 How to export a project from Netbeans 7.0 to 8.0.1? http://bighow.org/42363854-How_to_export_a_project_from_Netbeans_7_0_to_8_0_1_.html p How to export a project from Netbeans 7 0 to 8 0 2 Error NetBeans 8 0 2 can not open the form GUI Application you need an older version of netbeans 7 0 p 42363853 Java Mysql Backup and encrypt http://bighow.org/42363853-Java_Mysql_Backup_and_encrypt.html p I want to build backup feature for my java application Although I can backup the mysql database via java application problem is security of data and my application p p I want to protect database design and data from backup users Since I need a backup that cannot read p p Is there any secure way to keep my application backup p 42363852 Spatial queries with hibernate 5 and JPA http://bighow.org/42363852-Spatial_queries_with_hibernate_5_and_JPA.html p I use Spatial coordinates from hibernate 5 p pre code Spatial spatialMode SpatialMode HASH Indexed Entity public class Hotel Latitude Double latitude Longitude Double longitude code pre p The help from hibernate explain how to perform a spatial querry using a querry builder Is there a way to perform this request with spring data jpa p 42363851 Trying to convert string looking like "ÐавлÑк ÐÑкÑоÑ" to correctly looking string http://bighow.org/42363851-Trying_to_convert_string_looking_like_________________________________________to_correctly_looking_string.html p I ve got a problem converting string looking like to correctly looking string p p I m trying to use such way p pre code func stringToUTF16String stringaDaConvertire stringa String gt String let encodedData stringa dataUsingEncoding NSUTF16StringEncoding let attributedOptions NSDocumentTypeDocumentAttribute NSHTMLTextDocumentType let attributedString NSAttributedString data encodedData options attributedOptions documentAttributes nil error nil println attributedString string return attributedString string code pre p But I got a compiler error Type of expression is ambisious withou more context on that row p pre code let attributedString NSAttributedString data encodedData options attributedOptions documentAttributes nil error nil code pre 42363850 jLabel MouseEvent, Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException http://bighow.org/42363850-jLabel_MouseEvent__Exception_in_thread__AWT_EventQueue_0__java_lang_NullPointerException.html p I want to make button with hover using jLabel When I come over button errors appears I m using netbeans Most of the codes generated automatically p pre code public class anaEkrn extends javax swing JFrame public anaEkrn initComponents SuppressWarnings unchecked lt editor fold defaultstate collapsed desc Generated Code gt private void initComponents jPanel1 new javax swing JPanel jLabel1 new javax swing JLabel setDefaultCloseOperation javax swing WindowConstants EXIT ON CLOSE jLabel1 setIcon new javax swing ImageIcon getClass getResource market2 images tumu png NOI18N jLabel1 setText jLabel1 jLabel1 addMouseListener new java awt event MouseAdapter public void mouseEntered java awt event MouseEvent evt jLabel1MouseEntered evt public void mousePressed java awt event MouseEvent evt jLabel1MousePressed evt javax swing GroupLayout jPanel1Layout new javax swing GroupLayout jPanel1 jPanel1 setLayout jPanel1Layout jPanel1Layout setHorizontalGroup jPanel1Layout createParallelGroup javax swing GroupLayout Alignment LEADING addGroup jPanel1Layout createSequentialGroup addContainerGap addComponent jLabel1 javax swing GroupLayout PREFERRED SIZE 79 javax swing GroupLayout PREFERRED SIZE addContainerGap 197 Short MAX VALUE jPanel1Layout setVerticalGroup jPanel1Layout createParallelGroup javax swing GroupLayout Alignment LEADING addGroup jPanel1Layout createSequentialGroup addContainerGap addComponent jLabel1 javax swing GroupLayout PREFERRED SIZE 97 javax swing GroupLayout PREFERRED SIZE addContainerGap javax swing GroupLayout DEFAULT SIZE Short MAX VALUE javax swing GroupLayout layout new javax swing GroupLayout getContentPane getContentPane setLayout layout layout setHorizontalGroup layout createParallelGroup javax swing GroupLayout Alignment LEADING addGroup javax swing GroupLayout Alignment TRAILING layout createSequentialGroup addContainerGap 298 Short MAX VALUE addComponent jPanel1 javax swing GroupLayout PREFERRED SIZE javax swing GroupLayout DEFAULT SIZE javax swing GroupLayout PREFERRED SIZE addGap 23 23 23 layout setVerticalGroup layout createParallelGroup javax swing GroupLayout Alignment LEADING addGroup layout createSequentialGroup addGap 19 19 19 addComponent jPanel1 javax swing GroupLayout PREFERRED SIZE javax swing GroupLayout DEFAULT SIZE javax swing GroupLayout PREFERRED SIZE addContainerGap 328 Short MAX VALUE pack lt editor fold gt private void jLabel1MouseEntered java awt event MouseEvent evt ImageIcon icon new ImageIcon getClass getResource images tumu png jLabel1 setIcon icon private void jLabel1MousePressed java awt event MouseEvent evt ImageIcon II new ImageIcon getClass getResource images tumu hover png jLabel1 setIcon II public static void main String args Set the Nimbus look and feel lt editor fold defaultstate collapsed desc Look and feel setting code optional gt If Nimbus introduced in Java SE 6 is not available stay with the default look and feel For details see http download oracle com javase tutorial uiswing lookandfeel plaf html try for javax swing UIManager LookAndFeelInfo info javax swing UIManager getInstalledLookAndFeels if Nimbus equals info getName javax swing UIManager setLookAndFeel info getClassName break catch ClassNotFoundException ex java util logging Logger getLogger anaEkrn class getName log java util logging Level SEVERE null ex catch InstantiationException ex java util logging Logger getLogger anaEkrn class getName log java util logging Level SEVERE null ex catch IllegalAccessException ex java util logging Logger getLogger anaEkrn class getName log java util logging Level SEVERE null ex catch javax swing UnsupportedLookAndFeelException ex java util logging Logger getLogger anaEkrn class getName log java util logging Level SEVERE null ex lt editor fold gt Create and display the form java awt EventQueue invokeLater new Runnable public void run new anaEkrn setVisible true Variables declaration do not modify public javax swing JLabel jLabel1 private javax swing JPanel jPanel1 End of variables declaration code pre p There are so many errors under this error title p p Exception in thread AWT EventQueue 0 java lang NullPointerException p p What should I do p 42363849 Android Studio Start Failed http://bighow.org/42363849-Android_Studio_Start_Failed.html p I ve just installed android studio For the first time when I run that after a short while after showing a loading bar It shows me this error So I searched in Internet and I did Everything I could downloading the last version on Java re installing the Program and run it for the first time as administrator Adding the system variable code JAVA HOME code and etc but still it shows me a dialog with this information p pre code Internal error Please report to https code google com p android issues java lang RuntimeException java lang NullPointerException at com intellij idea IdeaApplication run IdeaApplication java 178 at com intellij idea MainImpl 1 1 1 run MainImpl java 52 at java awt event InvocationEvent dispatch InvocationEvent java 311 at java awt EventQueue dispatchEventImpl EventQueue java 756 at java awt EventQueue access 500 EventQueue java 97 at java awt EventQueue 3 run EventQueue java 709 at java awt EventQueue 3 run EventQueue java 703 at java security AccessController doPrivileged Native Method at java security ProtectionDomain 1 doIntersectionPrivilege ProtectionDomain java 75 at java awt EventQueue dispatchEvent EventQueue java 726 at com intellij ide IdeEventQueue dispatchEvent IdeEventQueue java 362 at java awt EventDispatchThread pumpOneEventForFilters EventDispatchThread java 201 at java awt EventDispatchThread pumpEventsForFilter EventDispatchThread java 116 at java awt EventDispatchThread pumpEventsForHierarchy EventDispatchThread java 105 at java awt EventDispatchThread pumpEvents EventDispatchThread java 101 at java awt EventDispatchThread pumpEvents EventDispatchThread java 93 at java awt EventDispatchThread run EventDispatchThread java 82 Caused by java lang NullPointerException at com android tools idea welcome AndroidVirtualDevice lt init gt AndroidVirtualDevice java 81 at com android tools idea welcome InstallComponentsPath createComponentTree InstallComponentsPath java 89 at com android tools idea welcome InstallComponentsPath init InstallComponentsPath java 215 at com android tools idea wizard DynamicWizardPath attachToWizard DynamicWizardPath java 97 at com android tools idea wizard DynamicWizard addPath DynamicWizard java 233 at com android tools idea welcome FirstRunWizard init FirstRunWizard java 75 at com android tools idea welcome FirstRunWizardHost setupWizard FirstRunWizardHost java 100 at com android tools idea welcome FirstRunWizardHost getWelcomePanel FirstRunWizardHost java 92 at com intellij openapi wm impl welcomeScreen WelcomeFrame lt init gt WelcomeFrame java 68 at com intellij openapi wm impl welcomeScreen WelcomeFrame showNow WelcomeFrame java 173 at com intellij idea IdeaApplication IdeStarter main IdeaApplication java 302 at com intellij idea IdeaApplication run IdeaApplication java 172 16 more code pre p What should I do now only for running Android Studio p 42363847 Positioning in css and html with bootstrap http://bighow.org/42363847-Positioning_in_css_and_html_with_bootstrap.html p I would like to create a block of 5 blocks of the same width with margins of 10px whose first div is in a fixed position or does not scroll All responsible or aligns verticalment mobile a href https fonts googleapis com css family Belleza rel nofollow https fonts googleapis com css family Belleza a rel stylesheet type text css a href https fonts googleapis com css family Raleway 400 500 700 rel nofollow https fonts googleapis com css family Raleway 400 500 700 a rel stylesheet type text css p pre code wrapper display flex bloc width 20 height 100vh background color 122b40 margin 10px code pre p p p p Div Fixed 2 3 4 5 p p 42363846 how to align a glyphicon to a form? http://bighow.org/42363846-how_to_align_a_glyphicon_to_a_form_.html p I m very sorry if this is just a simple question but I m really bad when it comes to alignment positioning of elements and stuff like that so here it goes p p My problem is shown here a href http imgur com a xscLJ rel nofollow http imgur com a xscLJ a p p a href http i stack imgur com TTs6V jpg rel nofollow img src http i stack imgur com TTs6V jpg alt picture of the issue a p p I just want the glyphicon to appear beside the textfield not above it Just that I tried putting it inside the form tag but the result is the same Here is my code p pre code lt div id form class collapse in gt lt div id loginwrong style display inline block vertical align top gt lt div id loginwrong2 style display none gt lt span class glyphicon glyphicon remove circle style color red font size 2em gt lt span gt lt div gt lt div gt lt form method POST class form inline role form gt lt input type password name pw placeholder Enter Password class form control gt lt input type submit class btn btn primary name submit value Submit gt lt form gt lt div gt code pre p I also have a script that will show the glyphicon if the password is wrong it s basically a password accepting textfield p pre code lt php echo lt script type text javascript gt loginwrong2 show lt script gt gt code pre 42363844 How to call a function from a DLL file from [ MQL5 ] code? http://bighow.org/42363844-How_to_call_a_function_from_a_DLL_file_from___MQL5___code_.html p strong Why strong the first strong code MessageBox code strong works and the second doesn t p p I don t know where the problem is p p Does the strong code MQL5 code strong can access the code dll code file p p I need to to call code C code functions that read strong code JSON code strong p p No errors appear in kbd MetaEditor kbd p p strong code C dll code strong file p pre code using System using System Collections Generic using System Linq using System Text using System Threading Tasks using System Runtime InteropServices namespace TestMe class Test DllExport Add CallingConvention CallingConvention StdCall public static int Add int left int right return left right public static int Sub int left int right return left right public static double AddDouble double left double right return left right public static float AddFloat float left float right return left right code pre p this is an strong code MQL5 code strong code p pre code import TestMe dll int Add int left int right int Sub int left int right float AddFloat float left float right double AddDouble double left double right import property strict MQL syntax mode modifier strict int OnInit int k 0 MessageBox k this call works k Add 1 666 MessageBox k Doesn t work return INIT SUCCEEDED code pre 42363843 Displaying data in Blade template http://bighow.org/42363843-Displaying_data_in_Blade_template.html p in my controller I pass my template a list of projects p pre code projects Project all return view projects index compact projects code pre p Now a Project has one client and a client belongs to a project If I loop my Projects within my view I get the following data p pre code attributes array 11 id gt 25 jobNumber gt J0001 projectName gt Some Name clientId gt 1 clientContact gt Some Contact contactEmail gt email email co uk status gt Email deleted at gt null created at gt 2016 04 25 14 15 19 updated at gt 2016 04 26 10 05 06 code pre p As you can see the clientId is 1 This links to a particular client Is there any way to get the client name using this ID I know how to do it in the controller but I can t pass a variable for each project which has the clients name this would be too much As it stands I am passing the view all of the projects and each of these has a clientId Somehow I need to get the named based off this p p Thanks p 42363842 Checking whether a JSON dictionary is empty or not and storing in a list http://bighow.org/42363842-Checking_whether_a_JSON_dictionary_is_empty_or_not_and_storing_in_a_list.html p I have an Instagram API which I load into a JSON The response is coming properly and I am even able to fetch the id from the data received Then I save it in a python list and put it in an Excel sheet using openpyxl p p Here is the catch While loading the values If there is no response from API in case of a deleted instagram account where the JSON will be empty I want to store ACC deleted in the list p p NOTE I also referred similar questions but didnt get my answer which works p p Here is the code p pre code for r in range 1 51 var r test cell row r column 1 value xy var 1 myopener Myopener url myopener open https api instagram com v1 users search q xy amp count 1 amp access token 641567093 1fb234f a0ffbe574e844e1c818145097050cf33 beta json load url for item in beta data list append item id HERE I WANT THE CHANGE for j in range len list for row in sheet iter rows min row j 1 max row j 1 for cell in row cell value list j wb save sample xlsx code pre p The json Response is this p pre code meta code 200 data username rawhawk sk profile picture https scontent cdninstagram com t51 2885 19 s150x150 12724928 109384759877664 1105313598 a jpg id 670907103 full name shwan mcswan code pre p If the json response is empty like below how to store ACC deleted in the list p pre code meta code 200 data code pre 42363841 How to make a list from DataFrame? http://bighow.org/42363841-How_to_make_a_list_from_DataFrame_.html p I have a DataFrame coordinates p pre code X Y Z 0 11 44 77 1 22 55 88 2 33 66 99 code pre p I need to get Y and Z columns values to a list If I do something like p pre code centers df Y df Z code pre p or p pre code Y df Y code pre p I got a list with index columns like p pre code print Y 0 44 1 55 2 66 code pre p How to create a list without indexes values 0 1 2 p 42363840 How do I use set_associated_object when the property I want to add is an unsigned int (enum)? http://bighow.org/42363840-How_do_I_use_set_associated_object_when_the_property_I_want_to_add_is_an_unsigned_int__enum__.html p Now I m doing it like this is it correct Any risks Thanks in advance p pre code void setNetworkStatus unsigned int object objc setAssociatedObject self selector networkStatus object OBJC ASSOCIATION ASSIGN unsigned int networkStatus return unsigned int objc getAssociatedObject self selector networkStatus integerValue code pre p I have changed OBJC ASSOCIATION ASSIGN to OBJC ASSOCIATION RETAIN NONATOMIC in my code Is there any problem p 42363839 How to validate all rows in a table using PHP http://bighow.org/42363839-How_to_validate_all_rows_in_a_table_using_PHP.html p below is the script where i am trying to validate if the same name id and email exists in a table the problem is that even if i add a new input for each field i still get a data already exist how do i fix this issue also how to validate using regular expression for each fields for id i need three letters and 3 numbers using regular expression p pre code if isset POST register Retrieve the field values from our registration form name empty POST name trim POST name null ccode empty POST id trim POST id null email empty POST email trim POST email null sql SELECT COUNT AS num FROM users stmt pdo gt prepare sql stmt gt bindValue name name stmt gt bindValue id id stmt gt bindValue email email stmt gt execute row stmt gt fetch PDO FETCH ASSOC if row num gt 0 die The Data already exists else sql INSERT INTO users name id email VALUES name id email stmt pdo gt prepare sql stmt gt bindValue name name stmt gt bindValue id id stmt gt bindValue email email result stmt gt execute if result echo User aadded successfully lt form action sign php method post gt lt label for name gt Name lt label gt lt input type text id name name name required gt lt br gt lt label for id gt id lt label gt lt input type text id name id required gt lt br gt lt label for email gt Email lt label gt lt input type email id email name email required gt lt br gt lt input type submit name register value Click to Add gt lt button gt lt form gt code pre p and how do i validate if the fields have same name for example i have 3 input fields in the first field i enter the name of a person and in the second or third field if i enter the same name an error should display when i click the submit button can it be done using a for loop to check each field if it contains the same name p 42363838 how to convert date column of a file into user input format http://bighow.org/42363838-how_to_convert_date_column_of_a_file_into_user_input_format.html p I have a file it has 7 columns and lacks of raws its date column format and number of date columns are dynamic maybe one or two or three columns date formats are code DD MON YYYY HH24 MI code or code DD MM YYYY HH MI code or code DD MON YYYY HH MI code etc p p file txt p pre code OIEX19 BANG37748 DEL37728 WUBXDE 200010291010 201209111625 195210290000 SEETA7 CHA38228 DEL37728 DGSDFE 201211190705 201308071912 195210291010 PRIYS3 ANK37748 DEL37728 KEJRSRC 196004080910 201407061815 195210292110 code pre p In the above column 5 and column 7 are date columns p p User input date format is code DD MON YYYY HH MI code p p Desired output p p file txt p pre code OIEX19 BANG37748 DEL37728 WUBXDE 29 10 2000 10 10 AM 201209111625 29 10 1952 12 00 AM SEETA7 CHA38228 DEL37728 DGSDFE 19 11 2012 07 05 PM 201308071912 29 10 1952 10 10 PM PRIYS3 ANK37748 DEL37728 KEJRSRC 08 04 1960 09 10 AM 201407061815 29 10 1952 9 10 PM code pre p How can I achieve it using code awk code p 42363837 how to show variable's value in pop up dialog with java swing http://bighow.org/42363837-how_to_show_variable_s_value_in_pop_up_dialog_with_java_swing.html p I am a beginner in programming I was messing around with java swing and tried to make a silly app This is my code It s not showing any errors but it s not working When the dialog pops up the variable s value doesn t show on the dialog The logic i used is right because when i run it in the compiler without the GUI stuff it works perfectly If anyone could tell what am i doing wrong in here it would be really helpful p p this is my code for the calculations p pre code import java awt FlowLayout import java awt event ActionListener import java awt event ActionEvent import javax swing JTextField import javax swing JFrame import javax swing JLabel import javax swing JButton import javax swing JOptionPane public class swingApp extends JFrame JLabel label JButton button public JLabel label2 JTextField textField new JTextField enter you nicknamae String username textField getText public int geniusMeter public int sum 0 public String sumAsString public void swingAppLogic String name char letters username toCharArray char alphabet a b c d e f g h i j k l m n o p q r s t u v w x y z int measure 7 3 1 13 8 26 15 18 2 5 22 20 16 9 5 11 23 12 25 6 4 21 24 14 17 10 for int count 0 count lt letters length count for int count1 0 count1 lt alphabet length count1 if letters count alphabet count1 geniusMeter measure count1 sum sum geniusMeter break sumAsString Integer toString sum public swingApp super Genius Calculator setLayout new FlowLayout label new JLabel Wanna know how genius you are label2 new JLabel button new JButton press enter and then click me to know the results handlerClass handler new handlerClass button addActionListener handler add label add label2 add button add textField public class handlerClass implements ActionListener public void actionPerformed ActionEvent event JOptionPane showMessageDialog null sumAsString Title JOptionPane INFORMATION MESSAGE code pre p and this is my main method p pre code import javax swing JFrame public class swingAppTester public static void main String args swingApp object new swingApp object setDefaultCloseOperation JFrame EXIT ON CLOSE object setSize 500 400 object setVisible true code pre 42363836 Print pdf file displayed inside iframe to printer http://bighow.org/42363836-Print_pdf_file_displayed_inside_iframe_to_printer.html p How can I print a pdf file displayed inside iframe directly to printer from Firefox IE p p The following code works in chrome opera well but not in IE and Firefox p p div class snippet data lang js data hide false div class snippet code pre class snippet code js lang js prettyprint override code function printIframe objFrame objFrame focus objFrame print code pre pre class snippet code html lang html prettyprint override code lt iframe id pdfreport name pdfreport src 1 pdf width 100 height 80 gt lt iframe gt lt button type button style float right name btnprint onclick printIframe pdfreport gt Print lt button gt code pre div div p 42363835 'for' loop explanation request http://bighow.org/42363835-_for__loop_explanation_request.html p I recently started learning python So I wrote some small code this code asks for 2 sizes of lists creates 2 lists with random integers from 0 9 and then spits out the intersection between two lists p p The last for loop I had trouble with it because at first my intersection list had repetitions then I looked up for an answer and got what I have now it works however I don t know why My problem is grasping how for i in l1 and in l2 works I know that for i in range k is going through the numbers 0 k but this strange for loop with the and operator just puzzles me p pre code l1 l2 C s1 int input Your 1st list size gt s2 int input Your 2nd list size gt for i in range s1 from random import randint k randint 0 9 l1 append k print First List gt l1 for i in range s2 from random import randint k randint 0 9 l2 append k print Second List gt l2 for i in l1 and l2 if i in l1 and l2 C append i print Intersection gt C code pre p Please let me know if there is another place to submit such questions if here is not for suitable p 42363834 String.contains function not working http://bighow.org/42363834-String_contains_function_not_working.html p I have to check whether the words from File1 exist in File2 or not and then count Data in both files is shown below p p The words in File1 are like shown below p ol li li li li li li li li li li ol p The data in File2 is like shown below p ol li li li 91 li li 92 li li 93 li li 94 li ol p The code I have written is as follows p pre code File file1 new File ChineseWord txt Scanner sc new Scanner new FileInputStream file1 ArrayList lt String gt list new ArrayList lt String gt ArrayList lt String gt newList new ArrayList lt String gt while sc hasNext list add sc next sc close File file2 new File RandomData txt Scanner newScanner new Scanner new FileInputStream file2 int count 0 for int i 0 i lt list size i while newScanner hasNext String word newScanner nextLine String toMatch list get i if word contains toMatch System out println Success count String test list get i newList add test exists count times count 0 code pre p The question is that it returns 0 for all words whereas the very first word in File1 exists in the very first line of File2 If I manually do something like this p pre code if word contains System out println Success count code pre p It prints successs otherwise it does not Why is this so p 42363833 spring-mvc + java +concurrency http://bighow.org/42363833-spring_mvc___java__concurrency.html p I have a problem that i make a spring mvc based web application in which multiple user wants to access my application simultaneously to perform operation I used some global constant in which i assign ip port and other information for a particular user like CAConstant IP CAConstant PORT etc I use these constant in different class to perform operation based on particular user The problem is that when multiple user access application concurrently then last user overwrite the global content of previous one that create conflict in final report when my main function was not synchronized So my problem is how can i resolve this problem or how we can allow multiple user to access same web application concurrently using thread in java p 42363832 Codeigniter: Store value of a dropdown into session variable http://bighow.org/42363832-Codeigniter__Store_value_of_a_dropdown_into_session_variable.html p I have a dropdown in the login page which fetches company codes and it s respective ID as value I need to store this particular value ID in a session variable so I may use it throughout site So that when that particular company is selected I may be able to view the details of that particular company If there is an alternate method for this kindly let me know p p strong MODEL strong p pre code public function login user this gt get by array company id gt this gt input gt post company id username gt this gt input gt post username password gt this gt hash this gt input gt post password TRUE this gt session gt set userdata user if count user Log in user data array username gt user gt username id gt user gt id loggedin gt TRUE is admin gt user gt is admin company id gt user gt company id this gt session gt set userdata data return TRUE code pre p strong VIEW strong p pre code lt tr gt lt td gt Location lt td gt lt td gt lt select class form control id company code name company code required gt lt option value 0 selected gt Select Company lt option gt lt php foreach locations as location selected user gt company id location gt company id selected selected echo lt option selected value location gt company id gt location gt company code lt option gt gt lt select gt lt td gt lt tr gt lt tr gt lt td gt Username lt td gt lt td gt lt php echo form input username class form control placeholder Enter User Name gt lt td gt lt tr gt lt tr gt lt td gt Password lt td gt lt td gt lt php echo form password password class form control placeholder Enter Password gt lt td gt lt tr gt lt tr gt lt td gt lt td gt lt td gt lt php echo form submit submit Log in class btn btn primary gt lt td gt lt tr gt code pre p I want the above code company id code to be posted into a session variable so it maybe used throughout the program Any help will be greatly appreciated p 42363831 "Can't set headers after they are sent" and empty post request body http://bighow.org/42363831-_Can_t_set_headers_after_they_are_sent__and_empty_post_request_body.html p I ve been following a tutorial for a login register authentication application I keep getting the error Can t set headers after they are sent whenever I send POST requests I tried to console log the request body and it were empty I don t know where I did wrong Please help p p strong users js strong p pre code var express require express var router express Router var User require models User GET users listing router get function req res next res send respond with a resource router get register function req res next res render register title Register router get login function req res next res render login title Login router post register function req res next var name req body name var email req body email var username req body username var password req body password var password2 req body password2 if req files amp amp req files profileimage console log Uploading file var profileimageOriginalName req files profileimage originalname var profileimageName req files profileimage name var profileimageMime req files profileimage mimetype var profileimageExt req files profileimage extension var profileimageSize req files profileimage size var profileimagePath req files profileimage path else var profileimageName noimage png req checkBody name Name field is required notEmpty req checkBody email Email field is required notEmpty req checkBody email Email field is not valid isEmail req checkBody username Username field is required notEmpty req checkBody password Password field is required notEmpty req checkBody password2 Password does not match equals req body password var errors req validationErrors if errors res render register errors errors name name email email username username password password password2 password2 else var newUser new User name name email email username username password password profileimage profileimageName User createUser newUser function err user if err throw err console log user req flash sucess You are now registered and may login res location res redirect module exports router code pre p strong app js strong p pre code var express require express var path require path var favicon require serve favicon var logger require morgan var cookieParser require cookie parser var session require express session var passport require passport var LocalStrategry require passport local strategy var bodyParser require body parser var expressValidator require express validator var flash require connect flash var multer require multer var mongo require mongodb var mongoose require mongoose var db mongoose connection var routes require routes index var users require routes users var app express view engine setup app set views path join dirname views app set view engine jade handle file upload var upload multer dest uploads uncomment after placing your favicon in public app use favicon path join dirname public favicon ico app use logger dev app use bodyParser json app use bodyParser urlencoded extended false app use cookieParser app use express static path join dirname public app use session secret secret saveUninitialized true resave true app use passport initialize app use passport session app use expressValidator errorFormatter function param msg value var namespace param split root namespace shift formParam root while namespace length formParam namespace shift return param formParam msg msg value value app use flash app use function req res next res locals messages require express messages req res next app use routes app use users users catch 404 and forward to error handler app use function req res next var err new Error Not Found err status 404 next err error handlers development error handler will print stacktrace if app get env development app use function err req res next res status err status 500 res render error message err message error err production error handler no stacktraces leaked to user app use function err req res next res status err status 500 res render error message err message error module exports app code pre 42363830 i need to print the sum of counters of unread note for more than one if i have 2 or more person http://bighow.org/42363830-i_need_to_print_the_sum_of_counters_of_unread_note_for_more_than_one_if_i_have_2_or_more_person.html p this code shows to me every student that do not read the notes so I need the counter of these unread to print it how can get the sum of all unread notes p pre code query mysql query SELECT FROM students WHERE parents id pid while r mysql fetch assoc query echo lt tr gt echo lt td gt lt b gt r first name r last name lt b gt lt td gt echo lt td gt r class name lt td gt quer mysql query SELECT count id FROM notes WHERE student id r id AND isread 0 count mysql fetch array quer c count 0 echo lt td gt lt b gt lt span style color red text align center gt c UnRread lt b gt lt td gt echo lt td gt lt b gt lt a href viewnote php viewnote amp sid r id amp name r first name amp last r last name gt View lt a gt lt b gt lt td gt echo lt tr gt code pre 42363829 Android sqlite database query with the columns needed taken from a String[] http://bighow.org/42363829-Android_sqlite_database_query_with_the_columns_needed_taken_from_a_String__.html p I have string array with columns I want to select p pre code String columns col1 col2 col3 code pre p The columns might change in the future but will always be a subset of available columns p p I cannot find a code SQLiteDatabase code API that lets me pass this array as columns The only solution I have so far is to just string join the columns with code code as separator and add it into my query string and perform a code rawQuery code p p Is there a better solution p p strong EDIT strong p p The query is a code JOIN code query p 42363828 Trying to post a variable from js to php within a if clause http://bighow.org/42363828-Trying_to_post_a_variable_from_js_to_php_within_a_if_clause.html p I am trying to post a variable within a if clause but the php document is not receiving the variable Here is some Code p p JS p pre code if data details payment type sofo var orderid data details order id post LinkToPhpDocument php orderidvalue orderid window location replace LinkToPhpDocument php code pre p PHP p pre code orderID POST orderidvalue code pre 42363827 Data Binding for alternative layouts http://bighow.org/42363827-Data_Binding_for_alternative_layouts.html p I have faced with an issue with data binding for different layouts I have layout file for different orientation For portrait mode p pre code lt layout xmlns android http schemas android com apk res android gt lt LinearLayout android layout width match parent android layout height match parent android orientation vertical gt lt FrameLayout android id id container android layout width match parent android layout height match parent gt lt LinearLayout gt lt layout gt code pre p and for landspace mode p pre code lt layout xmlns android http schemas android com apk res android gt lt LinearLayout android layout width match parent android layout height match parent android orientation vertical gt lt FrameLayout android id id container android layout width match parent android layout weight 1 android layout height match parent gt lt FrameLayout android id id extra container android layout width match parent android layout weight 1 android layout height match parent gt lt LinearLayout gt lt layout gt code pre p And when I use it for binding via p pre code ViewBinding binding DataBindingUtil setContentView this R layout view code pre p I have no access for code extraContainer code from current binding p p Possible solution to add the view with same id and check the view class in runtime Any other solutions p 42363826 Android: ThumbnailUtils.createVideoThumbnail return black bitmap http://bighow.org/42363826-Android__ThumbnailUtils_createVideoThumbnail_return_black_bitmap.html p I am dealing with the thumbnail in Android Even though I use the function code ThumbnailUtils createVideoThumbnail code provided by Android it gets black bitmap p p I start my research and find out some links br 1 a href http stackoverflow com questions 27351228 thumbnailutils createvideothumbnail return null bitmap for mp4 file Thumbnail null a br 2 a href http stackoverflow com questions 13303269 video thumbnail return null Video Thumbnail return null a br p p However I checked my returned bitmap and figure out that it is not null p p Please let me know if you have any ideas p p Any suggestion would be appreciated Thank you in advance p 42363825 Spring Batch Multiple Processors http://bighow.org/42363825-Spring_Batch_Multiple_Processors.html p Can we have multiple processors and single writer to write data in two different tables in spring batch p