FAQ Database Discussion Community


Evaluating condition of if statement in awk using a second file

bash,awk
I am trying to write a bash script that manipulates two files: file1 Region Coords. RsId Position Alleles Disease PValue OddsRatio RegionID 1p13.2 1:113839149..114551845 rs2476601 114377568 G>A Alopecia Areata 8.90E-08 1.34 869 2q13 2:111444884..111809030 rs3789129 111698040 A>C Alopecia Areata 1.50E-08 0.76 871 2q33.2 2:204611195..204817281 rs3096851 204763882 A>C Alopecia Areata 3.58E-08...

Unit testing a class A that derives from an abstract class B [closed]

c#,unit-testing
I am required to unit test a class B that derives from an abstract class A, which has some implementations. My question is: Should you unit test the parent type (e.g. the abstract ClassB) or the sub-class / derived type (e.g. ClassA)...

PHP displaying data from four tables in one query (ie: LEFT JOIN)

php,mysql,sql,mysqli,left-join
I have three tables: I want to display 'Event Details' which shows attending employee details (listo f employee ids from the 'attending_employees table > corresponding employee details form 'employee' table), what team they belong to (from the club_teams table) and the event details from the 'club_events' table). Currently I am...

JTable Printing. How to set page breaks programmatically?

java,swing,printing,jtable
I am trying to find a way to programmatically set page breaks for printing out a JTable. E.g., I have a table with approx 150 rows like this: Line Number Data1 Data2 Data3 …etc 1                    a         b        c        d 1...

How to parse XML from web services into NSArray in Objective-C

ios,objective-c,xml,nsdictionary,nsxmlparser
I am trying to parse this xml to my application, but my NSDictionary is always nil when I debug This xml <DADOS_MESA> <MESA> <Id>1076</Id> <Date>2015-05-08T09:44:25.343</Date> </MESA> <DADOS_MESA> I am requesting this XML from my WS, with NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://myIP/Services.asmx/GetDetails?CId=02&SId=01"]]; Then I create an NSDictionary NSDictionary *xml =...

Update a row using DataTable()

javascript,jquery,datatables
I would like to know the correct way to update/redraw a table row using the new API. Old questions suggest table.fnUpdate. Should I still be using the old API for this? The new API tells me nothing about updating rows. Thanks in advance!...

Can't access object in jquery (prevObject?)

javascript,jquery,html
A function in my WP plugin has just randomly (as far as I can tell) stopped working. Here's the code in question: window.send_to_editor = function(html) { var classes = jQuery('img',html).attr('class'); var items = classes.split(" "); ... more stuff here } I've confirmed that the html variable is indeed an img...

What is the advantages and disadvantages of writing return type java.util.Date or Date?

java
The methods is a basic part of the system core. public java.util.Date getCurDate(){...} public Date getCurDate(){...} What is the advantages and disadvantages of writing this return type?...

How to match a particular tag through css selectors where the class attribute contains spaces?

python,html,css-selectors,beautifulsoup,html-parsing
I want to select a table tag which has the value of class attribute as: drug-table data-table table table-condensed table-bordered So I tried the below code: for i in soup.select('table[class="drug-table data-table table table-condensed table-bordered"]'): print(i) But it fails to work: ValueError: Unsupported or invalid CSS selector: "table[class="drug-table" spaces in the...

Javascript pattern for library with dependencies

javascript,design-patterns
Sometimes I've come across a particular pattern present in some javascript libraries. Maybe it's a coincidence but I've seen it in libraries with dependencies. The syntax is as follows (The sample is taken from Backbone which has a hard dependency on underscore) (function(root, factory) { if (typeof define === 'function'...

Working with overlapping objects in storyboard

ios,uistoryboard
I'm working on an app where one of the screens will have a partially transparent overlay in some situations. I'm using a Visual Effect View for this. I now simply have this visual effect view on top of the other UI elements in my storyboard, but this means having to...

applying a Function to Each element in an array (O'Reilly cookbook example)

arrays,function,each,element,apply
for nested data. I tried <?php $names = array('firstnames' => array("Baba", "Billy"), 'lastnames' => array("O'Riley", "O'Reilly")); array_walk_recursive($names, function (&value, $key) { $value = htmlentities($value, ENT_QOUTES); }) foreach ($names as $nametypes) { foreach ($nametypes as $name) { print "$name\n"; } } ?> (An example from the book O'reilly PHP Cookbook 3rd...

How to add an extra metdata to a field of an object?

c#,attributes,metadata
I have an abstract class Node that everybody should implement in our office: public abstract class Node { public abstract void run(); } The implemented classes should also contain at least one input and one output properties. Please look at the following example: public class LineNode : Node { public...

Azure web site FTP access / 530 User cannot log in

ftp,azure
I'm trying to update an Azure Web Site using FTP. In the past, I was able to do this fine using the credentials from the .publishsettings file as has been widely documented. Today, I can't do that. Instead, I get a 530 User cannot log in. - even if I...

imagebutton: src should fit height but not lenght

java,android,imagebutton
I want my big picture to fit the whole screen, but also it should overlap at the width. have tried this: <ImageButton android:id="@+id/gameover" android:layout_width="wrap_content" android:layout_height="match_parent" android:src="@drawable/farmlvl1" android:scaleType="matrix" android:visibility="visible" /> have a look at the picture: ...

ftp client with async javascript

javascript,node.js,asynchronous,ftp,ftp-client
I'm writing in node.js and using async.js and ftp client modules. I'm using async.series and that is a function in async.series: var client = new ftp(); client.on('ready', function () { for ( var i = 0 ; i < stage._sub_directories.length ; i++ ) { var path = get_absolute_path() + DIRECTORY_NAME_LESSONS...

how to run a program under different user's accounts

user-controls,window
my program (C:\Program Files\MyApp\Myprog) starts with windows startup; at device insertion Myprog.exe invokes another program (C:\Windows\comp.exe). this process works fine in the admin account in which I install the program but Myprog.exe is unable to invoke comp.exe when users account is changed. I want (C:\Windows\comp.exe) to be invoke in each...

Button to delete the android application [duplicate]

java,android
This question already has an answer here: install / uninstall APKs programmatically (PackageManager vs Intents) 7 answers Is it possible thereotically to create an Android application that contains delete button within itself that deletes the app when pressed? ...

Save one part of a text file

python,python-3.x,text-files
I use a Rancid server to save information about Cisco switches on a network. I would like to write a Python 3 script to extract the configuration part of the data to a text file. I have gotten this to work but I have a file which has the configuration...

I'm not getting drop down list value related forms using panel control

asp.net
after getting drop down list as output, while selecting the users in drop down list i'm not getting related forms? review the code.i used panel control for 3 user detail tables protected void Page_Load(object sender, Eventargs e) { if (!IsPostBack) { AdminPanel.Visible = false; TeacherPanel.Visible = false; StudentPanel.Visible = false;...

Meaning of this set of instructions in Mic-1 [MAL Language]

assembly,cpu-architecture,microcoding,mal
The sequence of Mic-1 instructions below realize a new instruction bish8pu x (x is an offset in 8 bit in binary code). What is the meaning of this set of instructions? bish8pu1 MAR=SP bish8pu2 H=TOS << 8 bish8pu3 TOS=MDR=MBRU OR H;wr bish8pu4 PC=PC+1;fetch bish8pu5 goto Main1 Thanks a lot...

convert millisecond to Joda Date Time or for zone 0000

android,jodatime
please tell me how to convert milliseconds to joda Date time?? formatter = DateTimeFormat.forPattern("dd/MM/yyyy'T'HH:mm:ss").withZone(DateTimeZone.forOffsetHoursMinutes(00, 00)); even tried String millisecond="14235453511" DateTime.parse(millisecond); ...

Efficiently design method to construct a Java GUI?

java,swing,user-interface
This is for a school project where we implement a GUI for our previously made system, problem is our teacher only taught us JFrame. So in the end, what I have is, a JFrame for the MainScreen, and when I click a button to go the the OtherScreen, it will...

Is this aggregate initialization or default initialization in C++?

c++,initialization,aggregate-initialization
Consider following program. #include <iostream> int main() { int a=int{}; std::cout<<a; } Is it uses aggregate initialization or default initialization? I am confused....

Jquery Clone only the clicked elements contents

javascript,php,jquery,html
I have this issue which I'm sure I have solved before but cant for the life of me figure it out again. What I want to happen is one someone clicks a blend tile it clones that tile's featured image into the mixes area which it does but it kindly...

Configure providers from variables, in a generic way

ruby,chef,aws-opsworks
How can I create a recipe that will populate its attributes using the fiels from an instance of an object in a generic way? As an example, consider the following recipe: component = $auth_docker docker_image component.name do registry component.registry tag component.tag action :pull end When you have 50s of recipes...

Java read txt file string by string and write another txt keeping the position of the words

java,file,file-read,file-writing
i have a txt file that contain some words and what i want to do is to read this file one word at time (string), manipulate this string, and then write another txt file but keeping the position of the original words. For example, if my input is something like...

Haskell stripping function of syntactic sugar

haskell,syntactic-sugar
I'm wondering how would the following function look without any syntactic sugar: tails1 :: [a] -> [[a]] tails1 [] = [[]] tails1 [email protected](x:xs') = xs:tails1 xs' I'm mostly concerned with the usage of the @ operator, I've tried what follows, but that's obviously not the correct way tails1 ((:) x...

Find new values after a specific date

mysql
I need a bit help to solve this problem. I have a database that looks like this : Equipement | Card | SerialNumber | Date | other | irrelevant | columns toto1 | aaaa | a1a1a1 | 06/06/15 | efdfd | dfdfdfdfdf | dfdfdf toto2 | bbbb | b2b2b2 |...

Can this javascript code be cleaned up?

javascript,jquery,optimization
The code is working just fine now, but is a bit sloppy and long. I'm not as proficient in js as I would like to be. Javascript $("#IDArea1").click(function () { $('#indicator1').toggleClass("icon-caret-up icon-caret-down"); $('#indicator2').removeClass("icon-caret-up"); $('#indicator2').addClass("icon-caret-down"); $('#indicator3').removeClass("icon-caret-up"); $('#indicator3').addClass("icon-caret-down"); }); $("#IDArea2").click(function () { $('#indicator2').toggleClass("icon-caret-up icon-caret-down");...

Android Signature key differences between Old and New PC

android,key,signature
An existing package by the same name with a conflicting signature is already installed I had developed an inhouse app years back on an old PC and had deployed it. Now I got a new PC, that I used to work on some upgrades, but when I tried to upgrade...

Always fails when use the regex

regex,asp.net-mvc,data-annotations
I want to limit emails to those coming from my company only. This is what I have but it always fails: [Required] [EmailAddress] [Display(Name = "Email")] [RegularExpression(@"/\[email protected]\.com/", ErrorMessage = "You must use your mycompany email to register")] public string Email { get; set; } This email always returns an error:...

Cannot import caffe into python, libjpeg.so.62 not found

python,linux,anaconda,caffe
I cannot import caffe into (anaconda-) python. I'm following a notebook example on "logistic regression on non-image HDF5 data". When I execute the line import caffe I get the following error: --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-17-3524921938b5> in <module>() 8 sys.path.insert(0, caffe_root + 'python') 9 ---> 10 import...

vertical bar chart with validation

javascript,html,validation,charts
I changed my code abit, because i want some validation inside my code. before the the bars had the "%" on it and the name typed in under the bar, now if i type in 2 participants, it creates 4 bars instead of 2. At the place where the names...

Issue with nume1 in MATLAB

matlab
Here's a copy-paste of what MATLAB is doing after I type nume1(A) into the command window: nume1(A) %Undefined function 'nume1' for input arguments of type 'double'. Did you mean: numel(A) ans = 1034289 Does anyone know how to stop matlab from doing this? This is preventing me from using nume1...

SQL statement for a tricky 2 table query

sql
I'm struggling with SQL to much to get this working, table design is given, so I can't change it. Table 1 username usergroup flag ---------------------------- hans unit1 0 unit1 group1 NULL unit1 group2 NULL erwin unit1 0 jan unit2 0 jan unit1 0 unit2 group1 NULL unit2 group3 NULL Table...

Best way to make an HABTM association via console

ruby-on-rails,ruby
I have this scenario: class Order < ActiveRecord::Base has_and_belongs_to_many :products end class Product < ActiveRecord::Base has_and_belongs_to_many :orders end class CreateJoinTableOrdersProducts < ActiveRecord::Migration def change create_join_table :orders, :products do |t| t.index [:order_id, :product_id] t.index [:product_id, :order_id] t.decimal :price, precision: 8, scale: 2 t.integer :quantity, default: 1 end end end Now, I...

Macro cannot acces files on the network

vba,ms-word,word-vba
I am attempting to edit some Word files in a network path, put the Macro doesn't start. If i change the path to a local path (C: or D:), it works fine. I have full access to the network path. Directory = "S:\PROJETS\GT R\test\" FType = "*.doc" ChDir Directory FName...

How to populate a DropDownList in a DataGrid?

c#,html,asp.net,drop-down-menu,datagrid
I have a DataGrid that displays information about trailers. I decided to change the location column to a DropDownList so the location can be easily changed. But I am not sure how to populate the DropDownList. <asp:DataGrid runat="server" CssClass="tblResults" OnItemDataBound="dgList_ItemCreated" OnRowDataBound="OnRowDataBound" AllowSorting="true" OnSortCommand="dgTrailer_Sort" ID="dgTrailers" DataKeyField="ID" AutoGenerateColumns="false"> <Columns> <asp:BoundColumn DataField="TrailerOwner" HeaderText="Owner"...

Run SQL Server Update Statement With Powershell

powershell
Should be straight forward, but I keep getting this error shipping_status is not a recognized function name And this is my syntax - what is causing this, as my statement will run issue free in SSMS $SqlCmd = New-Object System.Data.SqlClient.SqlCommand $SqlCmd.Connection=New-Object System.Data.SqlClient.SqlConnection $SqlCmd.Connection.ConnectionString='Server=Server1;Database=DB1;Integrated Security=True' $SqlCmd.Connection.Open() $SqlCmd.CommandText="UPDATE firefly.light.dbo.shipped SET shipped =...

format a time series as dataframe with julian date

r
I have a time series tt.txt of daily data from 1st May 1998 to 31 October 2012 in one column as this: v1 296.172 303.24 303.891 304.603 304.207 303.22 303.137 303.343 304.203 305.029 305.099 304.681 304.32 304.471 305.022 304.938 304.298 304.120 Each number in the text file represents the maximum...

How to make methods from parent class use a different variable?

c++,inheritance
I have a class like this: class A { protected: class Node { public: int x; Node* next; }; Node* root; . . . }; And a lot of methods using this "root". Now, say I want to inherit from A class, and make all the methods use a "better"...

os.hostname() to return an IP

node.js,raspberry-pi,hostname
I have this raspberryPi with Node.JS running on top of it. By calling os.hostname(), the Pi returns "raspberry". I'm aware on how to modify this behaviour. What I don't know is how to do so in order to have it return an IP. The raspberry is connected in a distributed...

I want to Show Simple Toast Message When User Click On Media Controller button Pause/Start/Stop in video View Using Media Controller

android,android-layout,android-intent,android-fragments,android-activity
My Java Code and I know How To Play / Stop / Pause Video videoView=(VideoView)findViewById(R.id.videoView); // Video from raw Folder mediaController = new MediaController(this); uri = Uri.parse("android.resource://" + getPackageName() + "/"+ R.raw.abc); videoView.setVideoURI(uri); mediaController.setMediaPlayer(videoView); videoView.setMediaController(mediaController); videoView.requestFocus(); videoView.start(); ...

Unable to understand Cruise Control build error

svn,windows-server-2008,cruisecontrol.net
Please bear with me since I'm recent noob to Cruise Control. I'm getting following error while I force build process through dashboard. ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: . Process command: C:\Program Files\TortoiseSVN\bin\svn.exe log "http://xxx.xxx.xx.xx/svn/SampleProject/Source Code/" -r "{2015-06-08T13:00:07Z}:{2015-06-08T13:00:13Z}" --verbose --xml --username tom.bush --password ******** --no-auth-cache --non-interactive at...

CreateMutex on Windows 2012 with error code ERROR_ACCESS_DENIED

c++,windows,mutex
I am trying to create mutex on Windows 2012 with this code: CreateMutex(securityAttributes, FALSE, TEXT("Global\\test")); it always gives error code 5 (ERROR_ACCESS_DENIED). I have tried to create security attributes that I found here but with no success. Note that this code works on Windows 7. What could be a problem...

How to properly call handler method in C#?

c#,methods,parameters,handler
I am having issues with the following method below -GetTransactionsCompletedEventHandler. I am attempting to pass the necessary arguments to it, but it is also asking for more parameters in a format I am unfamiliar with. It is asking for GetTransactionsCompletedEventHandler(object[] results(object, GetTransactionsCompletedEventArgs)target) Can anyone point me in the right direction...

proengsoft/laravel-jsvalidation ReferenceError: jQuery is not defined

javascript,jquery,laravel-5,laravel-validation
I'm using proengsoft/laravel-jsvalidation to validate my custom form requests but it does not work with me, it gives ReferenceError: jQuery is not defined . Searched a lot about the problem even in its documentation but could not find it. Any help is appreciated. //app view @include('partials.nav') @include('errors.errors') @yield('content') <!-- Scripts...

saving an array in EEPROM

c,avr
I've a vectorx[8] and I want to save its value in the EEPROM of an XMEGA for that here is what I've done :: ............................ int16_t vec1[8]; int16_t vec2[8]; int16_t vec3[8]; int i = 0, j =1; for ( i =0 ; i<8; i++){ // ini vec1[i] = 23500; vec2[i]...

How to use installer variables in the uninstaller?

java,install4j
Here is my use case, so that you can understand why I need an uninstaller. I have to modify the content of a WAR file chosen in a screen with a file chooser, back it up with the database first, then modify the database, and then the WAR. The modification...

Slick query for one to optional one (zero or one) relationship

sql,jdbc,slick
Given tables of: case class Person(id: Int, name: String) case class Dead(personId: Int) and populated with: Person(1, "George") Person(2, "Barack") Dead(1) is it possible to have a single query that would produce a list of (Person, Option[Dead]) like so? (Person(1, "George"), Some(Dead(1))) (Person(2, "Barack"), None) ...

Background color change of found text in notepad++

colors,notepad++,highlighting
when i search a text pattern using "find all in current document" option in Find window, how to set the background of the selected result. Like currently i am searching "I" in the complete file, need the search result background to change when i select a particular line. attaching a...

Find mutually Edges with Spark and GraphX

graph,apache-spark,vertices,edges,spark-graphx
I'm really new to spark and graphx. My question is that if i have a graph with some nodes that have mutual(reciprocally) edges between them, i want to select the edges with a good performace. An example: Source Dst. 1 2 1 3 1 4 1 5 2 1 2...

How do I wrap text in a pre tag for Internet explorer?

html,css,internet-explorer,whitespace,word-wrap
I am using following code to wrap the <PRE> region in HTML: <PRE style = "white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"> It is working fine on chrome and Mozilla but the same is not working for IE. I am using IE9. Please tell me if any...

Duplicate key on mysql

c#,mysql
I have a POS system that will be used to create receipts in two different locations. the problem i am having right now is that when both location enter a receipt at the same time, they would have the same receipt ID, and therefore, i made a pretty bad way...

How to get Facebook subscriber count + friend count

php,facebook
Until few weeks ago I was able to get subscriber count & friend count for personal accounts in Facebook. Here's the code I used: $userid = '543766397'; $url = file_get_contents('http://api.facebook.com/method/fql.query?format=json&query=select+subscriber_count,+friend_count+from+user+where+uid%3D'.$userid); $decode = json_decode($url); $fb['subscriber_count'] = $decode[0]->subscriber_count; $fb['friend_count'] = $decode[0]->friend_count; Facebook has made changes to their service and the code above...

DriveApp.getFolderById Permissions

google-apps-script
I'm trying to "upgrade" an old script from DocsList to DriveApp and having a problem with a getFolderById call. The script had worked previously using DocsList.getFolder. I have a (previously-created) folder named "Email Archive" that I'm trying to access in script. Through using Logs and Execution Transcript, I've verified that...

Generate automatically name of the sheets

excel-vba
Is it possible to generate automatically the name of the sheet? For example I want to name the sheets in the following way: "chart1", "chart2", "chart3".. Thanks! ...

Stuck with spiral triangle

c++
I am looking for an algorithm that numbers and outputs a triangle with sides n (or half of a square) where n is an input of the program. But the numbering starts at the top of the triangle, goes down the diagonal, back along the bottom row and up the...

Verify field value for each list item in a REST response

java,rest,rest-assured
Let's say that we have the following json response: { "data": [ { "id": 1, "name": "Pablo" }, { "id": 2, "name": "Ernesto" } ] ... } Where the data list could consist of many more objects. If I where to verify that no name field is set to null,...

React - saving a component in the ref callback

reactjs
So, extract from https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute The ref attribute can be a callback function instead of a name. This callback will be executed immediately after the component is mounted. The referenced component will be passed in as a parameter, and the callback function may use the component immediately, or save the reference...

Store String var in awk command

bash,variables,awk
I have txt file like this: Dupont Charles Martin Paul Dupuis Jean I want, for each line, to make a login corresponding to first 2 caracters of each names. For instance : Dupont Charles ==> duch awk '{print tolower(substr($1,1,1)substr($2,1,1))}' liste.txt works perfectly. but i want to store each login in...

The difference between authority and scheme in an Android URI

android,uri,android-contentprovider,authority
What is the difference between URI authority and URI scheme in Android? I always use scheme in URI to indicate database table as follow: content://scheme I using custom search suggestion in my application, I read document about search custom suggestion in which authority used instead of scheme to reference database...

DynamoDb with sort?

node.js,sorting,amazon-dynamodb,inverted-index
I'm very new to the Dynamo Db concept so forgive me if my question is a bit stupid I have a file how looks like that Appel,www.appel.com,www.cnn.com,www.bla.com.... Blabla,www.test.com,www.fox.com,www.bla.com..... test,www.test.com,www.fox.com,www.bla.com... www.appel.com,300 www.cnn.com,400 and so on. In short each line is 1: a word and all the URL's she in them 2:...

Unexpected delays in jquery animations

javascript,jquery,animation,jquery-animate
I have a list-element that is initially set to max-height: 200px; overflow-y:hidden;. Beneath that element there is a h3-element you can click to show the entire list. For that purpose, I animated the maxHeight-property of the element with the jQuery animate() method. The animation should last 1.2 seconds. After that,...

C++ - Assign Complex to double

c++
I want to do this: Complex c(1, 2); double d = c; I tried to do friend double operator=(double& d, Complex& c){...} But got errors that assignment operator must be a non-static member, but how to assign Complex to double?...

No such property: id for class: java.lang.String

grails
I am sending the employee object from the Project_level controller to the _add_members view and then from there I am sending the employee object to the Project_permission controller. while saving the id the following error is coming: No such property: id for class: java.lang.String in the line :proj_permission.setId_of_employee(emp.id) class Project_levelController...

Need help in understanding perl tr command with /d

perl,translate
I came across the following Perl example on the web. #!/usr/bin/perl $string = 'the cat sat on the mat.'; $string =~ tr/a-z/b/d; print "$string\n"; result: b b b. Can someone please explain how ? ...

bootstrap grid layout questions

grid,bootstrap
http://i.imgur.com/QwbEHp5.jpg is there anyway to achieve the responsive grid layout above using bootstrap? i not sure whether this is the correct way to do it? <div class="container-fluid"> <div class="row"> <div class="col-md-6"><img src="http://s27.postimg.org/twfuw219f/256x256.jpg"></div> <div class="col-md-6 col-sm-3"><img src="http://s8.postimg.org/w0dxtotv9/256x120.jpg"></div> <div class="col-md-6 col-sm-3"><img...

How to skip a command in redo

vim
How is it possible to skip a command wile using redo (ctrl-R) ? I made a mistake and put my file in lowercase, I can go back and undo the command, how can I redo all the other commands done after?

Load fixtures in Rails

ruby-on-rails,ruby-on-rails-3,unit-testing
I am writing tests for a model Friends::New. My new_test.rb file looks like : require 'test_helper' class Friends::New < ActiveSupport::TestCase fixtures :news.yml end My news.yml is located in test/fixtures/friends/news.yml. But during running test, it tries to find news.yml in test/fixtures/. How do I tell it to search the yml file...

How to insert any table's column name in another table as record?

mysql,sql
I have a table with 50 columns. I want to insert all the column names into another table as record. How to do this? I am trying this, but it doesn't work. INSERT INTO fields(field) select * from INFORMATION_SCHEMA.COLUMNS where table_name='data' ...

How to sort these using Javascript or Jquery Most effectively

javascript,jquery,html
How to sort these using Javascript/JQuery Most effectively <div>6</div> <div>2</div> <div>7</div> <div>5</div> <div>9</div> <div>4</div> <div>8</div> <div>1</div> <div>3</div> ...

error while creating PDF

android,pdf,android-studio,itext
I am trying to generate a PDF using Android Studio. I am using the iText library, but when I add it into Android studio, I get the following error: Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2 When I remove the...

How does Robot's Telnet library work?

python,testing,robotframework
I've been taking a look at Robot's Telnet library(https://github.com/robotframework/robotframework/blob/master/src/robot/libraries/Telnet.py) and I haven't found an answer in the documentation to this question. I get that The Telnet object handles opening and closing of TelnetConnections, and stores the current connection. But when something like write is called, how does Robot know to...

Send push notification by using Parse from laravel web server to android device

laravel,parse.com,push-notification
I cant find how to send push notification by using Parse.com from my web server to android device using laravel. can anybody help me ?

Ionic $stateParams undefined

angularjs,ionic-framework,ionic
please help me with ionic $stateParams issue. Here is state configuration .state('tabs.categories', { url: "/categories/:parentID", views: { 'categories-tab': { templateUrl: "templates/categories.html", controller: 'CategoriesCtrl' } } }) Controller: angular.module('myApp').controller('CategoriesCtrl', ['$scope', '$http', '$stateParams', function($scope, $stateParams, $http){ console.log ($stateParams.parentID); }]); And view (if need): <ion-view view-title="Categories"> <ion-content> <a class="button button-clear"...

Array appending after each onclick and loop in javascript

javascript,jquery,arrays
This is the code fragment I have tried: radio.onclick = function() { var pp = e.target.result.split("\n"); var pq = pp.split('\n'); var pr = []; // array to append each values for (var k = 0; k < pq.length; k++) { var a = pq[0]; } pr = a; // I...

Why does PHP add “\r\n” to an empty string?

php,rest,request
I’m trying to implement a simple service in PHP. The service needs to return strings to certain requests. However, when I try to echo the string, PHP somehow adds \r\n to the beginning of the string. I am using echo to output the response. I tried to echo one space...

How can I catch all tooltips from my application & display it in Status bar in WinForms

c#,winforms
My task is simple. I want to catch any tooltip is show throughout a WinForms C# Application and then display it, as well, in the Status Bar. how to achieve such functionality? Thank you for helping....

ObservableInt causes crash on DataBinding Library

android,data-binding
I was playing with the new data binding library and tried to implement observable interface . But it keeps crashing no matter if i set the age variable to textview or not. The code works fine if i convert age variable to String. Is there any way to make it...

Writeline to already running process

c#
Here is my code: static void Main(string[] args) { if(args.Length > 1) { int id; if(int.TryParse(args[0], out id)) { try { var p = Process.GetProcessById(id); p.StandardInput.WriteLine(args[1]); } catch (ArgumentException) { Console.WriteLine($"Couldn't find process with id {id}"); } } else { Console.WriteLine($"Couldn't find process with id {args[0]}"); } } } I...

VBA Excel Dynamic Form Creation

excel,vba,excel-vba
Question: I have a form I created in Excel (Developer mode). The form has a MutliPage control on it. I am able to add a dynamically add new Page to the multipage control with VBA. I have no idea how to add any content onto this page that I have...

Doctrine batch inserting uses 2GB of Ram

php,symfony2,doctrine2,doctrine,batch-insert
I am trying to insert approximately 200k of records with Symfony2 and Doctrine via Doctrine Fixtures Bundle. I am using flush and clear but at the end script uses 1.8 GB of RAM. This is the class that loads SmartMeter entities into database: <?php namespace HTEC\SmartMeteringAPIBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\FixtureInterface;...

Restart or no Restart after config file change

sql-server,reporting-services,dynamics-crm,crm
I have to make a small change to a SQL server config file (http://www.msbicoe.com/post/2013/05/06/SSRS-2012-Report-Server-cannot-load-the-TERADATASQLPDW-Extension-Error.aspx). Do I need to restart the server in order for the changes to be made or will it be fine without? Determines if I have to wait till an appropriate time to take the server down...

onsubmit=“function()” is not working

javascript,jquery,onsubmit
I want to validate the dynamically added fields of the form(present in the templates/appname) in django. I am adding those fields with the help of the javascript (addInput.js - stored at a place mentioned as source in the script tag) which also has the logics for removing those fields as...

Change background of an Accessory View in a UITableViewCell

uitableview,swift
According to Apple docs UITableViewCell consists of two sections: I set a custom image for Accessory View: func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("settingCell") as! SettingsTableViewCell cell.setCellColor(self.items[indexPath.row]) let img = UIImage(named: "icon-right-arrow")! let imgView:UIImageView = UIImageView() imgView.contentMode = UIViewContentMode.ScaleAspectFill imgView.frame.size.width = img.size.width...

How do I submit a real-time validated form with Semantic UI and Meteor?

javascript,forms,validation,meteor,semantic-ui
I have run into a huge problem with my form, which I validate in real time using Semantic UI. The HTML: <form class="ui form pin-form"> <div class="field"> <label>Email</label> <input placeholder="[email protected]" name="email_input" type="text"> </div> <div class="ui buttons"> <input type="submit" class="ui submit positive disabled button login-button" value="Log in"> </div> </form> I added...

Create array with key and value in loop PHP

php,arrays,multidimensional-array,pdo
I'm using PDO, and I managed to get the table columns despite the table name and create the bind variables, like in ... VALUES (:foo, :bar);. The method I'm trying to do this is insert(). public function insert() { // the variable names depend on what table is being used...

JQuery get every image with 100px or more width

javascript,jquery
How do I get the length of every image with 100px or more of width: if( $('img').width( >= 100 ).length > 0 ){ [MORE CODE] } ...

Reload List after Closing Modal

angularjs,twitter-bootstrap,angular-ui-bootstrap
I have a list of brands: <script type="text/ng-template" id="list.brands"> <table class="table table-striped table-bordered bootstrap-datatable datatable dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info" ng-controller="BrandsCtrl"> <input type="text" ng-model="searchBox"> <thead> <tr> <th><tags:label text="brandid"/></th> <th><tags:label text="name"/></th> <th><tags:label text="isactive"/></th>...

Call a method in a .cs from javascript

javascript,c#,forms
I'm stacking with the following problem: I want to create a Template witch contains forms (3 textboxes and a button).Inside this template, through a javascript, have to call a function (CRUD method) that is inside a .cs. So...that's one of my CRUD function in EmployeeBL.cs : [WebMethod] public static bool...

Receiving POST from external application in AngularJS

javascript,angularjs,parameter-passing
I'm writing an application which uses AngularJS 1.4.0 which requires the ability to receive POST data from an external application. I know that routes in AngularJS often do parameters in the URL such as this: .when('/section/:param', { templateUrl: 'views/home.html', controller: 'AppCtrl' }) The problem with this style is that in...

The best way to get UNC path from local path

powershell,unc
I have the path like C:\Program Files\SomeApp, this path resides on the remote host, e.g. \\host1. I'd just like to replace a drive letter with an admin share, e.g. C:\ → C$ and add to this path a UNC prefix with a host name and get, eventually, the result like...

Entity Framework Code First with Fluent API Concurrency `DbUpdateConcurrencyException` Not Raising

c#,asp.net,asp.net-mvc,entity-framework,concurrency
I am trying to handle concurrency using entity framework 6. My entity looks like below; public partial class Group : BaseEntity { public byte[] RowVersion { get; set; } ............... } Mapping public partial class GroupMap : EntityTypeConfiguration<Group> { public GroupMap() { this.ToTable("CRM_Sales_Group"); this.HasKey(c => c.Id); //tried like this too...

Move python code to background after running a part of it

python,background-process
I have a python code, which has some part that needs to be run on foreground since it tells out if the socket connection was proper or not. Now after running that part the output is written into a file. Is there a way to move the running python code...

Is it valid to mutilayered a critical section?

c++,winapi,critical-section
For example, is this valid? CRITICAL_SECTION cs_A; CRITICAL_SECTION cs_b; ::InitializeCriticalSection( &cs_A ); ::InitializeCriticalSection( &cs_B ); ::EnterCriticalSection( &cs_A ); // First level /* do some stuff with A */ ::EnterCriticalSection( &cs_B ); // Second level /* do some stuff with A and B */ ::LeaveCriticalSection( &cs_B ); // Second level /*...

CodeIgniter - strlen() expects parameter 1 to be string, object given

php,codeigniter,php-password-hash
$query = $this->db->select('password')->get_where('members', array('email' => $this->input->post('email'))); if ($query->num_rows() == 1) { if (password_verify($this->input->post('password'), $query->row(1))) { return TRUE; } else { return FALSE; } } else { return FALSE; } I'm using the above code to verify user input password with hash from the database, and I'm using CodeIgniter which has...

C++ template using pointer and non pointer arguments in a QVector

c++,qt,templates,pointers
I'm trying to avoid having to use "nearly" the same code twice. I have the following template function, which searches for the provided value in a QVector and returns the index to the element. template<class tVec,class tVal> int upperBoundIndex(const QVector<tVec> &vec,int first,int last,tVal value) { //code here } Searching for...

geom_bar define border color with different fill colors

r,ggplot2
I want to draw a bar plot with geom_bar where I want unique fill colors surrounded by a black border. However the instruction color="black" is not interpreted as "black" as I want it to be and I get red borders. library(ggplot2) test=as.data.frame(cbind(a=c(1,1,2,3), b=1:4, c=as.character(1:4))) ggplot(test) + geom_bar(aes(x=a, y=b, fill=c, colour="black"),...