hariom

1

votes
0

answer
10

views

API to list activity log in Urban Airship

I'm using PHP with CURL to send push notification by using API of Urban Airship to android and ios devices for more than hundred apps. Now I want to list activity logs like Airship panel but could not find any suitable API like we use for push '/api/push' and for list schedule 'api/schedules' so cou...
Hariom
1

votes
0

answer
41

views

ANTLR4 not able to parse normal text

I want to parse latex file so that i can convert it into html. I started with basic minimum text file. But the tree created by 'grun Tex_grammar start -gui' is showing errors. I think there is some error in the code which i am not able to figure out Below is my Grammar code: ////////////////////////...
Hariom Ahlawat
1

votes
2

answer
962

views

How to use old database in lokijs?

I am using framework7 with lokijs. To use lokijs database, i need to create new database everytime with new loki(dbname) how do i create a database on my first run and from next runs just load that database ?
Hariom Sharma
1

votes
2

answer
1k

views

Using jstl in sightly

I have a jstl which is used for cleaning the html fragment between the tag from a jsp file. But in current scenario, all my components are in sightly. I want to achieve the same. Is it possible to somehow use that tag in sightly?
Hariom Tomar
1

votes
1

answer
161

views

Seek field of video node is not working properly

I am working on video player using video node of Scene Graph Component. My issue is when i set seek field like m.video.seek = 20 it's start playing from 15 seconds or 18 seconds but not from exact position 20 seconds. My code is... inner = createObject('RoSGNode', 'ContentNode') inner.url = 'http:/...
Hariom
1

votes
1

answer
75

views

PHP array with n level deep

Assuming I have an array and recursively want to do some task. I have spent one day for this unable to solve this. May be my logic is not good. Any help on how to do such thing in an efficient way would save my days. I have an array with n level deep, looking like: Array ( [0] => Array ( [name] => u...
Hariom
1

votes
2

answer
30

views

Pandas Combining data in two excel

I have two excel Excel 1 files language blank comment code 15 C++ 66 35 354 1 C/C++ Header 3 7 4 Excel 2 files language blank comment code 16 C++ 33 35 354 1 C/C++ Header 3 7 4 1 Python 1...
Hariom Singh
1

votes
2

answer
43

views

Is this possible to create subdomains on local server?

I am working on a project using ZF3 and my requirenment related to local server. Suppose user 'test' login on the system then url for that user should be http://test.10.1.1.55 I have already googled for this and found a post Create subdomains on the fly with .htaccess (PHP) For production environme...
Hariom
1

votes
1

answer
536

views

How to unit test (with QUnit and Sinon) Compiled Code(Closure Compiler Advanced Compilation)

I have created a few unit tests for my uncompiled code with QUnit and used sinon to mock functions when needed. But the problem is, after the advanced compilation by the Closure Compiler the function names are changed and thus the Unit Test Cases don't apply to the Compiled Code. I have read here h...
hariom
1

votes
1

answer
451

views

Expected primary-expression before numeric constant

For the below code #include template class Invert { public: static bool const result = !T; }; int main() { bool test = Invert::result; std::cout
Hariom Singh
1

votes
1

answer
95

views

Add percentage column to panda dataframe with percent sign

For the below excel which will be used as panda dataframe df['% '] = (df['Code Lines'] / df['Code Lines'].sum())*100 Output comes Language # of Files Blank Lines Comment Lines Code Lines % C++ 15 66 35 354 3.064935065 C/C++ Header 1 3...
Hariom Singh
1

votes
1

answer
11

views

How to combine unitest textrunner log with logging

How to log the debug or info comments to the generated log file from python unit test import unittest import logging class Arming(unittest.TestCase): def testCase1(self): logging.info('I told you so') actual = 3 expected = 3 self.assertEqual(actual,expected) def testCase2(self): actual = 3 expected...
Hariom Singh
1

votes
1

answer
40

views

Why there is no closure for Z

1.)Why the closure is not generated for example 1 whereas for example 2 there is closure. 2.)Example 1 Even though there is no closure for Z how I am able to get the value from outer function for Z (As once the local function scope is over all the objects are garbage collected or retained based...
Hariom Singh
7

votes
2

answer
444

views

Laravel migrate command is not working for remote database

I am working on a project using the Laravel 4.2 framework. I want to execute the command php artisan migrate but when I run this command it shows an error: [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1142 CREATE command denied to user 'abc'@'10.1.1.27' for table 'migrations' I...
Hariom
1

votes
1

answer
773

views

NumberFormatter::formatCurrency return NaN with “fr_FR.UTF-8”

The following issue occurs with apache on Ubuntu 13.04(not sure about other OS's) I tried with fr_LU too but to no avail Doesn't work -returns NaN setlocale(LC_MONETARY, 'fr_FR.UTF-8'); $currency_formatter = NumberFormatter::create(setlocale(LC_MONETARY, '0'), NumberFormatter::CURRENCY); $currency_f...
hariom
1

votes
3

answer
5.4k

views

Java how to work with getDeclaredField(“someVaraible”) method

I am using Jooq in application and i am using a comparator and my code is omething like this public void columnsList(List records){ Collections.sort(records, new StampDateComparator()); for(TableRecord record : records){ Table table = record.getTable(); Field[] fields = table.fields(); for(Field fie...
Hariom
6

votes
3

answer
4.7k

views

How to strip unicode in a list

I want to strip unicode string from the list for example airports [u'KATL',u'KCID'] expected output [KATL,KCID] Followed the below link Strip all the elements of a string list Tried one of the solution my_list = ['this\n', 'is\n', 'a\n', 'list\n', 'of\n', 'words\n'] map(str.strip, my_list) ['this',...
Hariom Singh
4

votes
2

answer
111

views

Why we have to specify data type again after the arrow symbol ( -> )

auto can deduce the return type then why do we need trailing arrow symbol (->) to deduce the return type #include auto add (int i, int j)->int { return i+j; } int main() { int x=10,y=20; std::cout
Hariom Singh
2

votes
4

answer
128

views

MISRA C:2012 Rule 14.4

As per the MISRA rule The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean type #include #include void foo(void){ int i = 0; if(i){} /* Non-compliant - int32_t is not boolean */ if(i != 0){} /* C...
Hariom Singh
1

votes
3

answer
513

views

Pandas convert column from str to float

For the below dataframe I am using the code df['%'] = ((df['Code Lines'] / df['Code Lines'].sum()) * 100).round(2).astype(str) + '%' output Language # of Files Blank Lines Comment Lines Code Lines % C++ 15 66 35 354 6.13% C/C++ Header 1...
Hariom Singh
3

votes
1

answer
2.4k

views

Android web view displays white screen

Android webview display white screen instead of loading the website on Android 4.1.2 .The website perfectly opens when I open it from web browser, I am using following code public class MainActivity extends AppCompatActivity { WebView web; @Override public void onCreate(Bundle savedInstanceState) {...
Hariom Mangal
3

votes
3

answer
579

views

Fibonacci using constexpr function (compile time vs run time)

I am using constexpr to get the Fibonacci number Enumeration is used to calculate the fibonacci in compile time #include constexpr long fibonacci(long long n) { return n < 1 ? -1 : (n == 1 || n == 2 ? 1 : fibonacci(n - 1) + fibonacci(n - 2)); } enum Fibonacci { Ninth = fibonacci(9), Tenth =...
Hariom Singh
3

votes
1

answer
47

views

Using Auto based Ranged for loop vs using pair based Ranged for loop

In the below code #include #include #include int main() { std::unordered_mapm; m['1']=1; m['2']=2; for(const std::pair&p :m) { std::cout
Hariom Singh
1

votes
3

answer
2.5k

views

How to make QUnit wait for certain interval of time?

I have defined several test cases in QUnit. The last of those test cases open a specific URL in a new window using window.open function and append the html content of body tag of the the newly opened page to the current page's( on which tests are running) body tag. Also, I need to execute that test...
hariom
2

votes
1

answer
1.4k

views

Is there a way to clone native functions in javascript like window.alert or document.write

What I want to do is change every alert in the code to a custom alert('you used alert'); var hardCodedAlert = alert; //I know this won't work.But what to do ? window.alert=function(){ if(this.count == undefined) this.count=0; this.count=this.count+1; if(this.count == 1) hardCodedAlert('You used aler...
hariom
4

votes
3

answer
235

views

why if(a==2.3) evaluates false when float a=2.3 [duplicate]

This question already has an answer here: Why Are Floating Point Numbers Inaccurate? 4 answers #include void main() { float a = 2.3; if(a == 2.3) { pritnf('hello'); } else { printf('hi'); } } It prints 'hi' in output, or we can say that if condition is getting false value. #include void main() { fl...
Hariom
1

votes
4

answer
423

views

Warning “C++ requires a type specifier for all declaration” map

I am running this code in xcode .Why my compiler keeps on complaining for map assignment #include #include #include using namespace std; map bucket; deque A{3,2,1}; deque B; deque C; bucket[1] = A;//Warning 'C++ requires a type specifier for all declaration bucket[2] = B;//Warning 'C++ requires...
Hariom Singh
1

votes
2

answer
706

views

for-loop with NULL condition, why printf(); execute? [closed]

‎#include int main() { for(;NULL;) printf('STACK'); return 0; } output: STACK I know NULL have ascii value 0 and it's false, but when i run on turbo c, this program give output 'STACK', how it is possible.
Hariom Yadav
7

votes
6

answer
756

views

Pointer with same memory address with different value

I casted the memory address from double to an integer . Even though they point to the same address why the values are different ? #include using namespace std; int main() { double d = 2.5; auto p = (int*)&d; auto q = &d; cout
Hariom Singh
2

votes
5

answer
65

views

F.54: If you capture this, capture all variables explicitly (no default capture)

Slightly got confused after reading this Cppcore Guideline F.54 Regarding the lambda capture 'Writing [=] in a member function appears to capture by value, but actually captures data members by reference ' Example class My_class { int x = 0; // ... void f() { int i = 0; // ... auto lambda = [=]{ us...
Hariom Singh
2

votes
1

answer
126

views

How to add Django_app.models inside items.py of Scrapy my project

my file structure, both django folder(mysite) and scrapy folder(intex) are in same directory. | mysite (django folder) | mysite | settings.py | urls.py | polls | admin.py | models.py | db.sqlite3 | manage.py | intex (scrapy folder) | intex | spider | spiders.py | items.py here's my models.py file: f...
Hariom Yadav
2

votes
1

answer
1.4k

views

Fatal error: Class 'Phalcon\Http\Client\Request'

Error on request Fatal error: Class 'Phalcon\Http\Client\Request' not found in ControllerBase.php on line 41 use Phalcon\Http\Client\Request as CRequest; $provider = CRequest::getProvider(); $provider->setBaseUri('http://localhost/testing');
4

votes
1

answer
117

views

Does template argument deduction takes return type into account?

I am going through 'C++ Templates: The Complete Guide (Second Edition)', page 10. As per the book, template argument deduction doesn't take return type into account. Template Deduction can be seen as part of overload resolution. A process that is not based on selection of return types. The sole exce...
Hariom Singh
3

votes
1

answer
91

views

Fold Expression template argument deduction/substitution failed

Trying to Learn fold expression .Getting error for argument deduction failed #include template struct sum{ T value; template sum(Ts&&...values) : value{(values + ...)}{}//error here }; int main() { sum s(2,3,4); } Error main.cpp: In function 'int main()': main.cpp:11:16: error: class template arg...
Hariom Singh
2

votes
2

answer
1k

views

Does zend framework 3 supports zftool?

I'm creating a new application in Zend Framework 3 and I have a question about zftool. Is zftool works with zend framework 3? Because I have googled and found that zend framework 3 does not supports zftool. If zend framework does not support zftool then how we can create modules? Another issue: I ha...
Hariom
2

votes
1

answer
1.5k

views

How to print exact sql query before execute in Zend Framework 2

I am working on an application using Zend framework 2. I'm using TableGateway to select, insert, update and delete query. 1. My question is how to print exact sql query before executing INSERT, UPDATE and DELETE statement? For SELECT statement here is my code which is working for me. $selectedTable...
Hariom
3

votes
2

answer
1.1k

views

How to Create TableRecord Object?

i was trying to create method (Which is a common method so that i can pass any Table class object to it ) like below which will take List of TableRecord as a argument and get table name and column names as well so i am doing below code . public void getColumns(List records){ for(TableRecord record...
Hariom
7

votes
2

answer
151

views

Use of templates to raise the level of abstraction of code?

I'm going throught T.1 of the CppCoreGuidelines, and there are the following examples Example 1 template // requires Incrementable T sum1(vector& v, T s) { for (auto x : v) s += x; return s; } Example 2 template // requires Simple_number T sum2(vector& v, T s) { for (auto x : v) s = s + x; return s;...
Hariom Singh
1

votes
2

answer
366

views

Prevent Logcat from automatically clearing

I am using Android Studio 1.2.2 and Logcat sometimes automatically clears itsself after my app crashes. How can I prevent this behaviour?
hariom
2

votes
1

answer
149

views

Return from the max function Stepanov Notes [duplicate]

This question already has an answer here: Why does std::max return the wrong value? [duplicate] 1 answer max() template according to Stepanov Notes intentionally return b
Hariom Singh

View additional