Justus

-1

votes
1

answer
20

views

Sort on date inside foreach loop with php

I am trying to build a function that displays the reviews from an external json feed in a loop with php. Everything works fine, except the sorting. I would like to sort the items based on date. This is the actual code which i created: ''
Justus
1

votes
1

answer
259

views

rake db:seed failing on pending migration when there are none

I'm running a (previously working fine) seed file like so: I check to see if there are pending migrations with rake db:migrate:status and all migrations are 'up'. For additional context, here's what led me to this point: Working in 6 year old Rails Code Start a branch for feature 'A' Wrap feature 'A...
Justus Eapen
1

votes
1

answer
2.7k

views

ReactJS testing with Jest fails: Cannot read property 'buffer' of undefined

When i try to test the react component LoginForm.js i am getting an error in LoginForm. i am require a module called joi in LoginForm. TypeError: /home/jaisonjustus/project/captainmice/src/components/LoginForm/test/LoginForm.js: /home/jaisonjustus/project/captainmice/src/components/LoginForm/src/jsx...
Jaison Justus
1

votes
2

answer
113

views

Line by line check for large amount of keywords with python

I am iterating through many csv files with 1000 to 3000 lines checking each line whether one of 70000 key words is inherited in a text of 140 characters. My problem at the moment is, that my code runs extremely slow. I guess because of the many iterations. I am relatively new programer and not sure...
Justus Niemzok
1

votes
1

answer
3.6k

views

Trigger click event from one file from another in BackboneJS

in my project i am not able to trigger click event registered in one backbone view from another backbone view. its actually i am having a file type input placed hidden from the user and i need to trigger the file type input. var FileView = Backbone.View.extend({ .... events : { 'click .delete-image...
Jaison Justus
1

votes
3

answer
646

views

Syntax error in model and controller after setting up Paperclip Gem

I'm burning through the onemonthrails tutorial. And I've just installed the paperclip gem and set up the model with some validations. I thought I followed the tut exactly but when I go into the localhost:3000/pins I get this weird syntax error that points to both the model and the controller. I didn...
Justus Eapen
1

votes
2

answer
4.4k

views

Update and sort Qt ComboBoxes alphabetically

I want to write a program, working like a little navigation system uisng the Qt framework, but i still am very new to it. I created a dialog with two Comboboxes. Each combobox contains all 'citynames'. At the initialization the content of both boxes is sorted alphabetically. If a name in the first...
Justus Schock
1

votes
2

answer
630

views

ios tableView clearColor seperator

I have set my tableView's background color, and I want there is space(10px) around each cell show that color. e.g.(ignore the red line) What I am doing now is make the cell embed a smaller view, and set the cell's background to be clear. But it is annoying to create such embed view again and again....
3

votes
4

answer
1.7k

views

Process single Thymeleaf fragment with Spring Boot

In my Spring Boot application, I need to process a single Thymeleaf Fragment to get its rendered HTML output. I'm injecting @Autowired private SpringTemplateEngine templateEngine; and then try to Context context = new Context(); context.setVariable('key', value); String html = this.templateEngine.pr...
justus
2

votes
1

answer
80

views

How do I solve this circular dependencies?

Given these classes forming a flexible tree: class ElementBase(object): pass class Form(ElementBase): pass class TextInput(ElementBase): pass class DateTimeInput(ElementBase): pass class NumberInput(ElementBase): pass If an element is inside a Form it should be able to find said form. Since this is...
Justus Wingert
11

votes
1

answer
4.8k

views

how to write a directive in angularjs

i like to make a custom component using directive. i checked lot of tutorials and its get confusing me can anyone explain how a directive works. the component i am planing to make is the template for shout list will be like this {{shout.message}}
Jaison Justus
21

votes
4

answer
10.9k

views

RedBean ORM performance [closed]

I would like to know, can Redbean ORM be used for performance oriented scenarios like social networking web apps, and is it stable even if thousands of data is pulled by multiple users at same time? Also I'd like to know whether Redbean consumes more memory space? Can anyone offer a comparison study...
Jaison Justus
2

votes
3

answer
11.4k

views

Error creating bean with name 'dataSource' + Spring Boot + Hibernate

I have a few problems starting up the spring guide on how to access mysql data (see this link: https://spring.io/guides/gs/accessing-data-mysql/). I adjusted the classes slightly, so I have this code: pom.xml 4.0.0 org.springframework gs-mysql-data 0.1.0 org.springframework.boot spring-boot-starter-...
justus
3

votes
4

answer
5.8k

views

How to get array defined in a php file to a variable

I have a php file named config.php in which I defined the application settings in an array format like Inside the main app files I need to get the array to a variable, so that they can be used like this. I would like to know if there is there any alternative method to do like this instead of using i...
Jaison Justus
2

votes
3

answer
6.8k

views

CgridView pagination html issue

i am using the cgridview widget to display some data and using pagination too. but the problem i am have is i need to replace the pagination div. i need to place it on the footer of page like but when i check the html code the pagination div is automatically created by the widget, some div like is a...
Jaison Justus
2

votes
2

answer
914

views

How can I update a global python variable within the customJS function in bokeh?

how is it possible to update the python variable extern_python_variable when the slider is moved in the example below? The value of extern_python_variable should always be f (the actual position of the slider). Thanks! from bokeh.io import vform from bokeh.models import CustomJS, ColumnDataSource, S...
justus
2

votes
2

answer
1.3k

views

How to handle possibly HTML encoded values in javascript

I have a situation where I'm not sure if the input I get is HTML encoded or not. How do I handle this? I also have jQuery available. function someFunction(userInput){ $someJqueryElement.text(userInput); } // userInput '' returns '